rjweb-server-ejs
v1.6.0
Published
Easy and Lightweight Way to render EJS files in rjweb-server
Downloads
11
Maintainers
Readme
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.