1.2.1 • Published 2 years ago

@omega0x013/flat-express v1.2.1

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
2 years ago

flat-express

Flat express is a route definition function that turns a JS object into an express.Router.

Usage

let router = flat({
  "/":
    "index.html",           // You can statically serve a file using a filename

  "/hello": (req, res) =>   // Or you could bind just the GET route for a path
    res.end("Hello World!"),// by using a function.

  "/greet": {               // And finally you could bind a whole set of
    "GET": (req, res) =>    // methods to a single route, by placing them into
      res.end("Greetings"), // an object. 
    "POST": /* example */   // In an object like this one, each value must be
    "DELETE": /* example */ // a function.
  }
})
1.2.1

2 years ago

1.2.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago