Generate Express.js-compatible route middleware for js-data models.
To get started, visit http://js-data.io.
importexpressfrom'express'import{mount,queryParser,Router}from'js-data-express'import{Container}from'js-data'constapp=express()conststore=newContainer()constUserMapper=store.defineMapper('user')constCommentMapper=store.defineMapper('comment')// Mount queryParser and store at "/"mount(app,store)// Mount queryParser and store at "/api"mount(app,store,'/api')// Mount queryParser at "/"app.use(queryParser)// Mount store at "/"app.use(newRouter(store).router)// Mount queryParser at "/api"app.use('/api'queryParser)// Mount store at "/api"app.use('/api',newRouter(store).router)varapi=app.route('/api')// Mount queryParser at "/api"api.use(queryParser)// Mount UserMapper at "/api/user"api.use('/user',newRouter(UserMapper).router)// Mount UserMapper at "/api/comment"api.use('/comment',newRouter(CommentMapper).router)- Quick start - Get started in 5 minutes
- Guides and Tutorials - Learn how to use JSData
js-data-expressGuide - Learn how to usejs-data-express- API Reference Docs - Explore components, methods, options, etc.
- Community & Support - Find solutions and chat with the community
- General Contributing Guide - Give back and move the project forward
The MIT License (MIT)
Copyright (c) 2014-2016 js-data-express project authors
