generator-opinionated-express-mvc
v1.1.3
Published
Scaffolding for an Express API using PostgreSQL with knex and bookshelf.
Downloads
34
Maintainers
Readme
opinionated-express-mvc
Scaffolding for building an Express API
Description
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.
Installation
Global Install
To install globally, simply run:
npm install -g yo
npm install -g generator-opinionated-express-mvc
Local Install
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
Setup
To generate your new project run:
global
$ yo opinionated-express-mvc
local
$ 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.
Todo
- 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
Contributing
- fork/clone
- make changes
- submit a PR
License
MIT © shane barringer