npm install mysql
run trough the installer and dont forget your passwordnpm install dotenv --save
this will install dotenvrequire("dotenv").config();
add .env to your gitignore- In order to get the DB working you need to use a .ENV file including
DB_HOST=
DB_USER=
DB_NAME=
DB_PASSWORD=
- then Open the terminal navigate to shelter run
npm start
, open up another tab and runsudo service mysql start
to start mysql
A partially working Express server. Can you fix and finish it?
Fork this repository, cd
into it, and:
npm install
npm run build # build and minify static files
npm start # runs server on `localhost:1902`
There’s a lot of things left to do. See the assignment description for more info.
build.js - crawls new data (probably not needed)
db/data.json - raw data in json format
db/image/ - images for all animals
db/index.js - interface for accessing data
db/readme.md - docs for `db`
server/ - web server
server/helpers.js - utility functions used in the views to render animals
server/index.js - express server
src/index.css - unprocessed styles
src/index.js - unprocessed scripts
static/ - output of `src` after processing (these are sent to the browser)
view/detail.ejs - ejs template for one animal
view/list.ejs - ejs template for all animals
view/error.ejs - ejs template for errors
npm start
— Start the server (on port 1902)npm test
— Tests the databasenpm run lint
— Check browser code and node code for problemsnpm run build
— Build browser code
Data is crawled (by build.js
) from nycacc.
If you have the means to do so, you should consider becoming a foster parent,
volunteering at your local animal shelter, or donating!