Nibbling Pastry Monster

    chef-express
    TypeScript icon, indicating that this package has built-in type declarations

    1.3.0 • Public • Published

    chef-express

    npm package version tests status

    static files server designed for node written in typescript, with tests

    • express for routing

    Running

    $ [PORT=4200] [yarn|npx] chef-express folder [--debug] [--ssl] [--key example.key] [--cert example.crt]
    const startServer = require("chef-express");
    
    startServer({
      // this enables http/ws logs
      debug: process.argv.includes("--debug"),
      // port on which the server listens
      port: Number(process.env.PORT || 4200),
      // folder to static serve files
      folder: process.argv[2],
      // ssl = undefined | { key, cert }
      ssl: process.argv.includes("--ssl") ? ssl : undefined,
    }).then((server: Express.Application) => {
      // server router api is get, post, any
      server.any("/*", (req: Express.Request, res: Express.Response) => {
        res.end("200 OK");
      });
    });
    • PORT=4200 - choose server port
    • folder - folder you want to serve static files from
    • --debug - show logs
    • --ssl - start as https server, with self signed certificate
    • --key example.key - path to real certificate key, use with --ssl
    • --cert example.crt - path to real certificate, use with --ssl

    Install

    $ yarn add chef-express

    License

    MIT

    Install

    npm i chef-express

    DownloadsWeekly Downloads

    13

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    6.53 kB

    Total Files

    10

    Last publish

    Collaborators

    • jacekpietal