Server

High level api for node.js server.
Table of contents
Presentation
jsenv/jsenv-server github repository publishes @jsenv/server
package on github and npm package registries.
@jsenv/server
helps to start server with a simplified api to focus on writing your application code. The api make your code easier to compose and test in isolation.
Code example
The following code starts a server listening to http://127.0.0.1:8080
responding Hello world
as plain text.
import { startServer } from "@jsenv/server"
startServer({
protocol: "http",
ip: "127.0.0.1",
port: 8080,
requestToResponse: () => {
return {
status: 200,
headers: {
"content-type": "text/plain",
},
body: "Hello world",
}
},
})
api
Api can be found in their own pages
Installation
npm install @jsenv/server@1.0.0