Everyone needs an API these days, right?
Folders look like this:
.
├── src
│ ├── api # API modules (i.g. user, auth, etc.)
│ ├── db # Database connection module
│ ├── job # Recurring jobs
│ ├── middleware # Express middlewares
│ ├── migration # Database migrations
│ ├── model # Application model classes
│ ├── seed # Database seeds
│ ├── schema # Schemas
│ ├── script # Script files (sql, bash, etc.)
│ ├── util # Resuable modules
│ └── index.js # Application entry file
└── test # Test files
Note: some files were omitted for simplicity.
git clone https://github.com/ruanmartinelli/api-starter.git <NEW_NAME>
cd <NEW_NAME>
# make it yours:
rm -rf .git
git init
yarn install
mv .env.example .env
npm run db:latest
Note: this assumes you have MySQL installed
npm run dev
Start the server in Production mode:
npm start
Start the server in Development mode:
npm run dev
Show lint errors:
npm run lint
Show lint errors and fix minor issues:
npm run lint:fix
Run AVA tests:
npm t
Run AVA tests in watch mode:
npm run test:watch
Generate API documentation:
npm run docs
user.js
, script/
)function x() { }
instead of const x = () => {}
MIT © Ruan Martinelli