Skip to content

dmail-old/server

Repository files navigation

Server

npm package build codecov

Simplified api to create server using node.js.

Table of contents

Presentation

dmail/server github repository publishes @dmail/server package on github and npm package registries.

@dmail/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 "@dmail/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 @dmail/server@2.4.0

About

Simplified api to create server using node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published