rjweb-server-ejs
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

Welcome to rjweb-server-ejs 👋

A rjweb-server Middleware to render ejs templates easily

Install

npm i rjweb-server-ejs

or

yarn add rjweb-server-ejs

or

pnpm add rjweb-server-ejs

Usage

Rendering a File & Setup

const { Server } = require('rjweb-server')
const { eJS } = require('rjweb-server-ejs')

const server = new Server({
  port: 8000
}, [
  eJS.config({})
])

server.path('/', (path) => path
  .http('GET', '/', (http) => http
    .onRequest((ctr) => {
      ctr.printEJS('./index.ejs')
    })
  )
)

server.start().then((res) => {
  console.log(`Server started on port ${res.port}`)
})

Author

👤 0x4096

Show your support

Give a Star if this project helped you!

📝 License

Copyright © 2023 0x4096.
This project is MIT licensed.

Package Sidebar

Install

npm i rjweb-server-ejs

Weekly Downloads

1

Version

1.6.0

License

MIT

Unpacked Size

14.3 kB

Total Files

13

Last publish

Collaborators

  • 0x4096