Scaffolding for building an Express API
Sets up an Express API configured for use with Postgres database through bookshelf and knex. Includes two resources with restful route configuraiton and associations.
This generator assumes user has postgres installed and running on your machine.
To install globally, simply run:
npm install -g yo
npm install -g generator-opinionated-express-mvc
If you don't have permissions to install packages globally follow the following steps
$ mkdir <your-app-name>
$ cd <your-app-name>
$ yarn init -y
$ yarn add yo
$ yarn add https://github.com/shanebarringer/generator-opinionated-express-mvc.git
To generate your new project run:
$ yo opinionated-express-mvc
$ yarn yo opinionated-express-mvc
note: this generator creates a directory for your project. If you've run the local install option, your project will be nested in a new directory. To fix this issue, mv
the entire directory up one level by running $ mv <your-app-name>/* ./ && mv <your-app-name>/.* ./
Once the install/setup is complete, you'll be able to run the server and view the available resources at http://localhost:3001
. Once satisfied, run the cleanup script.
$ yarn cleanup
This command will leave the directory structure intact, while removing the existing models, migrations, seeds, routes, etc.
- Add test configuration with Mocha and Chai
- Add additional logic (and prompts) for using alternative relational databases technologies
- Scaffolding commands
- Potential support for adding a React view layer
MIT © shane barringer