Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Latest commit

 

History

History
50 lines (35 loc) · 903 Bytes

readme.md

File metadata and controls

50 lines (35 loc) · 903 Bytes

backend-example

Example with a mysql database, simple front-end, and a Node server.

Install

Install the project:

git clone git@github.com:wooorm/backend-example.git
cd backend-example
npm install

You also need mysql, of course. I did the following on OS X with homebrew:

brew install mysql
brew services start mysql
mysqladmin -u root -p # prompts to create a new password

Store your password, user, and name in a .env file, like so:

DB_HOST=localhost
DB_USER=root
DB_NAME=backendexample
DB_PASSWORD=mypassword

Fill the database:

mysql -u root -e 'CREATE DATABASE IF NOT EXISTS backendexample' -p
node populate # crawls an API and stores stuff in the database.

Finally, do:

npm start # run server on localhost:2000.