Awesome Open Source
Awesome Open Source


a example of eggjs, mongodb, restful api and other stuff made it work...

Examples for egg


make sure you nodejs version >7.0 install mongodb start mongodb import data.json to mongodb

  1. create Collection: "web_admin" "web_news" "web_newsType" "IdGenerator"
  2. create Documents in data.json run npm to start server npm start
$ npm install
$ npm start

REST API Example

Follow the naming conventions of rails:

method url file path controller name
GET /api/{objects}[?per_page={per_page}&page={page}] app/controller/{objects}.js index()
GET /api/{objects}/:id app/controller/{objects}.js show()
POST /api/{objects} app/controller/{objects}.js create()
PUT /api/{objects}/:id app/controller/{objects}.js update()
DELETE /api/{objects}/:id[s] app/controller/{objects}.js destroy()

api/users GET List


api/users/1 GET Single Data


api/users/2 PUT Update data with uid


api/users POST insert data


same with news and news_type for rest api data.

Alternatives To Egg Mongodb Example
Select To Compare

Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,157,171
Mongodb (32,045
Rest (29,187
Rest Api (17,959
Egg (2,208
Eggjs (493
Egg Plugin (235
Eggjs Example (3