flummpress

2.0.7 • Public • Published

flummpress

Usage Example

import path from "path";
import flummpress, { router, views } from "flummpress";

(async () => {
  const port = 8080;
  (await new flummpress())
    .listen(port)
    .on("listening", () => {
      console.log(`flummpress is listening on port ${port}`);

      // new route GET
      router.get(/^\/$/, (req, res) => {
        res.reply({
          body: "hello world!"
        });
      });

      // new route POST
      router.post(/^\/$/, async (req, res) => {
        const postdata = await req.post;
        console.log(postdata);
        res.reply({
          body: "hello post!"
        });
      });

      // public folder
      router.static({
        dir: path.resolve() + "/public",
        route: /^\/public/
      });
    });
})();

documentation

coming soon

Readme

Keywords

none

Package Sidebar

Install

npm i flummpress

Weekly Downloads

0

Version

2.0.7

License

MIT

Unpacked Size

15.1 kB

Total Files

5

Last publish

Collaborators

  • flummi
  • jkhsjdhjs