@andrei-markeev/express-mini
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

express-mini

Minimalistic Express-like web server with zero dependencies.

Installation

npm i @andrei-markeev/express-mini

Usage

import * as app from "@andrei-markeev/express-mini"

app.get("/hello", async () => ({ text: "Hello world!" }));
app.get("/test", async () => ({ html: "<html><body><h1>Test</h1></body></html>" }));

app.listen(3000, __dirname + "/public", () => console.log("Server listens on port 3000"))

In this example, server will serve static files from the public folder (relative to the script directory).

If you don't need automatic static file serving, pass null.

Readme

Keywords

none

Package Sidebar

Install

npm i @andrei-markeev/express-mini

Weekly Downloads

0

Version

0.0.9

License

MIT

Unpacked Size

13.5 kB

Total Files

6

Last publish

Collaborators

  • andrei-markeev