Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Small generators for APIs and CRUDS with Express and MongoDB
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
.gitignore
README.md
api_routes_template.js
api_template.js
db_template.js
package.json

README.md

Mongo Express Generators

Generate express apps with MongoDB (using mongojs).

Installation

You can install it through npm

[sudo] npm install mongoexpressgen -g

Usage

The first thing you have to do is generate your express app and add the mongojs dependency.

mkdir myapp
cd myapp
express
# edit the package.json to add the mongojs dependency
npm install

After that you can start using the generators to generate your db configuration file.

mongoexpressgen db atlasdb countries cities

where atlasdb is the name of the MongoDB database and countries and cities are the names of the collections in said database.

After that you can generate a RESTful API with the generator.

mongoexpressgen api countries

Now you can run your app and test your API.

node app.js
# Go to http://localhost:3000/countries and test your API.

What's next?

Right now the mongoexpressgen only generates RESTful APIs. The next step is to make it generate full CRUDS with forms and views. I will try to work on this shortly.

Something went wrong with that request. Please try again.