static files server designed for node written in typescript, with tests
express
for routing
$ npx chef-express folder
const { cook } = require("chef-express");
cook({ folder: "folder" }).then((server: Express.Application) => {
// server api is get, post, any
server.any("/*", (req: Express.Request, res: Express.Response) => {
res.end("200 OK");
});
});
- minimal configuration is zero configuration, all values have defaults
- if
folder
param is omitted defaultindex.html
is read fromfolder = '.'
- serves from http://localhost:3000 unless
port
specified
For more information about config parameters read:
- The default configuration https://git.1-hub.cnchef-js/core#configuration
- The parameters types https://chef-js.github.io/core/types/Config.html
MIT