Skip to content

Commit a4c8969

Browse files
committed
cloud developer c2 add code
lesson exercise code and project code.
1 parent 86de043 commit a4c8969

File tree

244 files changed

+42160
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+42160
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Specifies intentionally untracked files to ignore when using Git
2+
# http://git-scm.com/docs/gitignore
3+
4+
*~
5+
*.sw[mnpcod]
6+
*.log
7+
*.tmp
8+
*.tmp.*
9+
log.txt
10+
*.sublime-project
11+
*.sublime-workspace
12+
.vscode/
13+
npm-debug.log*
14+
15+
.idea/
16+
.ionic/
17+
.sourcemaps/
18+
.sass-cache/
19+
.tmp/
20+
.versions/
21+
coverage/
22+
www/
23+
node_modules/
24+
tmp/
25+
temp/
26+
platforms/
27+
plugins/
28+
plugins/android.json
29+
plugins/ios.json
30+
$RECYCLE.BIN/
31+
32+
.DS_Store
33+
Thumbs.db
34+
UserInterfaceState.xcuserstate
35+
node_modules
36+
venv/
37+
.vscode
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# udacity-c2-basic-server
2+
3+
This is a simple node-express server to explore and understand the Request-Response pattern.
4+
5+
***
6+
## Getting Setup
7+
8+
### Installing project dependencies
9+
10+
This project uses NPM to manage software dependencies. NPM Relies on the package.json file located in the root of this repository. After cloning, open your terminal and run:
11+
```bash
12+
npm install
13+
```
14+
>_tip_: **npm i** is shorthand for **npm install**
15+
16+
### Installing useful tools
17+
#### 1. [Postbird](https://github.com/paxa/postbird)
18+
Postbird is a useful client GUI (graphical user interface) to interact with our provisioned Postgres database. We can establish a remote connection and complete actions like viewing data and changing schema (tables, columns, ect).
19+
20+
#### 2. [Postman](https://www.getpostman.com/downloads/)
21+
Postman is a useful tool to issue and save requests. Postman can create GET, PUT, POST, etc. requests complete with bodies. It can also be used to test endpoints automatically. We've included a collection (`./udacity-c2-restapi.postman_collection.json `) which contains example requsts.
22+
23+
***
24+
25+
## Running the Server Locally
26+
To run the server locally in developer mode, open terminal and run:
27+
```bash
28+
npm run dev
29+
```
30+
31+
Developer mode runs off the TypeScript source. Any saves will reset the server and run the latest version of the codebase.
32+
33+
***
34+
## Important Files and Project Structure
35+
36+
The source code for this demo resides in the ./src directory.
37+
38+
### src/server.ts
39+
The main code for this demo is located in the ./src/server.ts file. This includes
40+
41+
### src/cars.ts
42+
This is a javascript object containing a list of cars. This will be useful for providing data for our simple endpoints.
43+
44+
### src/unit-test-examples/
45+
This directory contains some simple unit functions (`units.ts`) and corresponding tests using Mocha and Chai (`units.tests.ts`).
46+
47+
***
48+
# Tasks
49+
1. @TODO `./src/server.ts/`
50+
Add an endpoint to GET a list of cars.
51+
52+
2. @TODO `./src/server.ts/`
53+
Add an endpoint to get a specific car.
54+
55+
3. @TODO `./src/server.ts/`
56+
Add an endpoint to post a new car to our list.
57+
58+
4. @TODO `./src/unit-test-examples/units.ts`
59+
Try creating a method "concat" to concatenate two strings.
60+
61+
5. @TODO `./src/unit-test-examples/units.tests.ts`
62+
Try creating a new describe block for the "concat" method.

0 commit comments

Comments
 (0)