node.js REST API scaffold to create dummy endpoints on localhost.
- local
mysqldatabase nodepackage installed on your machine
- run
mysql -u {username} -p {database_name} < db_schema.sqlto import the db schema - create
.envfile in root directory of this project - add environment variables for your mysql configuration, see example syntax below
- add your new endpoints under
/routes/{your_endpoint}.js - add your routing to
app.js - run
npm start curl localhost:3000/{your_endpoint}
DB_HOST=localhost
DB_USER=root
DB_PASS=pass
DB_NAME=database_name
API_SECRET=helterskelter