This repository was archived by the owner on Feb 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
packages/createrest-express Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ! dist
2+ lib
3+ examples
4+ docs
5+ .github
6+ .nyc_output
7+ coverage
Original file line number Diff line number Diff line change 1+ # createrest-express
2+
3+ [ ![ Travis] ( https://img.shields.io/travis/atomixinteractions/createrest-express.svg )] ( https://travis-ci.org/atomixinteractions/createrest-express )
4+ [ ![ Coverage Status] ( https://coveralls.io/repos/github/atomixinteractions/createrest-express/badge.svg?branch=master )] ( https://coveralls.io/github/atomixinteractions/createrest-express?branch=master )
5+ [ ![ npm] ( https://img.shields.io/npm/v/createrest-express.svg )] ( https://npmjs.com/createrest-express )
6+ [ ![ GitHub tag] ( https://img.shields.io/github/tag/atomixinteractions/createrest-express.svg )] ( https://github.com/atomixinteractions/createrest-express )
7+ [ ![ license] ( https://img.shields.io/github/license/atomixinteractions/createrest-express.svg )] ( https://github.com/atomixinteractions/createrest-express )
8+
9+
10+ ## Readme
11+
12+ Express middleware for [ createrest] ( https://github.com/atomixinteractions/createrest )
13+
14+ ## Usage example
15+
16+ ``` js
17+ const { createRest , printRoutes } = require (' createrest' )
18+ const { createExpressMiddleware } = require (' createrest-express' )
19+ const express = require (' express' )
20+
21+ const app = express ()
22+
23+ const routes = createRest (e => {
24+ // Your routes here
25+ })
26+
27+ app .use (createExpressMiddlware (routes))
28+
29+ app .listen (3000 , () => {
30+ printRoutes (routes)
31+ console .log (' Listening port 3000...' )
32+ })
33+ ```
You can’t perform that action at this time.
0 commit comments