rapid-express v1.3.9
rapid-express
Easily setup an express backend
rapid-express is a framework similar to create-react-app that quickly sets up a new express backend project. It embraces the flexibility of create-react-app while making small opinionated decisions to help you move quickly in the spirit of Ruby on Rails.
Setup
npm install -g rapid-express
or
yarn global add rapid-express
Creating a new project
Now that rapid-express is installed globally navigate to the directory in which you wish to create this project
then run:
create-express YourProjectName
rapid express will generate a new project for you. Complete with a preconfigured express server, a routes file, a models folder, a .gitignore file, a README, and finally a package json with dependencies already installed.
cd into the project and run 'npm start'
Creating new endpoints
Your project has the ability to quickly create GET, PUT, POST, and DELETE endpoints for you. All endpoints are located in the routes.js file.
To make new endpoints:
npm run new-endpoints yourNewEndpointName
Warning: Endpoints are case-sensitive.
Here is an example you might see:
npm run new-endpoints user
What this does:
When run, new-endpoints will create a new file in your models folder with GET, PUT, POST, and DELETE model functions.
The models are imported into the routes.js file and used in the new endpoints that were created.
Potential Changes
I'm currently considering:
giving the option of setting up views when a project is created
configuring a database (postgres/knex.js or mongoDB) when a new project is created
If you want any additional features please contact me or you can submit a Github issue/PR.