├── .gitignore ├── README.md ├── index.html ├── package.json └── server.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | DS_Store 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > [!NOTE] 2 | > This repo is from an archived version of the course. Watch the latest version of the course on [frontendmasters.com](https://frontendmasters.com/courses/api-design-nodejs-v4/). 3 | 4 | ## Getting started 5 | * `npm i` 6 | 7 | ## Todo 8 | 9 | create a basic server with express 10 | that will send back the index.html file on a GET request to '/' 11 | it should then send back jsonData on a GET to /data 12 | 13 | ## Fetch all branches locally 14 | 15 | ``` 16 | git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done 17 | git fetch --all 18 | git pull --all 19 | ``` 20 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | hey 6 | 7 | 8 |

hey

9 | 10 | 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-api", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "body-parser": "^1.13.2", 13 | "express": "^4.13.1", 14 | "lodash": "^3.10.0", 15 | "morgan": "^1.6.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | // TODO: create a basic server with express 2 | // that will send back the index.html file on a GET request to '/' 3 | // it should then send back jsonData on a GET to /data 4 | 5 | var jsonData = {count: 12, message: 'hey'}; 6 | --------------------------------------------------------------------------------