1.3.0 • Published 9 years ago

generator-express-rest-api v1.3.0

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

Build Status

generator-express-rest-api

Summary

This is a Yeoman generator to quick scaffold a RESTful API using expresss, cluter-service, mocha, chai, sinon, and istanbul. The structure generated follows the MVC controller/service/repository pattern.

Installing Yeoman

http://yeoman.io/learning/index.html

Windows Pre-Requisites

Python 2.7.x: https://www.python.org/downloads/

Installing Generator

> npm install -g generator-express-rest-api

Scaffolding Application

> yo express-rest-api

Scaffolding Controller, Controller Test, and Updates Route Config

> yo express-rest-api:controller

Scaffolding Service and Service Test

> yo express-rest-api:service

Scaffolding Repository and Repository Test

> yo express-rest-api:repository

Application NPM Commands

// installs everything that is required to run your new application
> npm run install-local
// runs application
> npm start
// runs application in debug mode
> npm run debug
// runs mocha tests
> npm test
// runs istanbul code coverage
> npm run test-coverage

Application Folder Structure Example

package.json
server.js
\app
\..\config
\..\settings
\..\..\settings-config.js
\..\route.config.json
\..\route-config.js
\..\worker-config.js

\..\controllers
\..\..\v1
\..\..\..\users
\..\..\..\..\users-controller.js

\..\services
\..\..\users
\..\..\..\user-service.js

\..\repositories
\..\..\users
\..\..\..\user-repository.js
\test
\..\spec
\..\mocha.opts
\..\tests.initialize.js

\..\..\controllers
\..\..\..\v1
\..\..\..\..\users
\..\..\..\..\..\users-controller.tests.js

\..\..\services
\..\..\..\users
\..\..\..\..\user-service.tests.js

\..\..\repositories
\..\..\..\users
\..\..\..\..\user-repository.tests.js

Example Application: Marvel Node API

https://github.com/trwalker/marvel-node

1.3.0

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.2

9 years ago

0.0.1

10 years ago