JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q5992F
  • License ISC

It's a really simple, barebones router for node.js. It's called wowter because that's what it sounds like when a cute child tries to say router, and the design is so naive and simple that it's like a child made it.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wowter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Wowter 😲

    A simple router for node.js

    A VERY barebones router for node.js. It's called wowter because that's what it sounds like when a cute child tries to say router, and the design is so naive and simple that it's like a child made it.

    Usage

    import { createRouter } from "wowter"
    import { CORS, JSONParser, FileUpload } from "wowter/middleware"
    
    const dir = "./public"
    const uploadDir = "./uploads"
    
    const middleware = [CORS, JSONParser]
    
    const routes = {
      "/api/upload": {
        "/upload": {
          POST: (req, res) => {
            FileUpload({
              dir: uploadDir,
              maxFileSize: 1000000,
            })
          },
        },
      },
      "/special": {
        GET: (req, res) => {
          res.end("You found the secret!")
        },
      },
    }
    
    const router = createRouter(routes, middleware, dir)
    
    router.listen(8080, () => {
      console.log("Listening on port 8080")
    })

    Installation

    npm install wowter
    
    # or
    
    bun install wowter
    
    # or
    
    yarn add wowter
    
    # or
    
    pnpm add wowter