|
1 |
| - |
2 | 1 | # REST API with Node using Typescript
|
3 | 2 |
|
4 | 3 | This is a simple REST API developed using node and express with typescript
|
5 | 4 |
|
6 |
| - |
7 |
| - |
| 5 | + |
8 | 6 |
|
9 | 7 | ## Requirements
|
10 |
| -[Node.js](https://nodejs.org/en/), [postgresql](https://www.postgresql.org/download/) |
| 8 | + |
| 9 | +[Node.js](https://nodejs.org/en/), [postgresql](https://www.postgresql.org/download/) |
11 | 10 |
|
12 | 11 | ## Setup DB
|
13 |
| -1) you need to install PostgreSQL and then set the following environment variable |
14 |
| - `C:\Program Files\PostgreSQL\10\bin`, |
15 |
| - `C:\Program Files\PostgreSQL\10\lib` |
16 |
| -2) rename `.env-sample` to `.env` in the file the DB connection string need to be updated accoring to your `credentials`. |
17 |
| - ex : `postgres://<YourUserName>:<YourPassword>@localhost:5432/<YourDatabase>` |
18 | 12 |
|
19 |
| -3) you can find the DB and other details under `src/db` |
20 |
| -create database with the name `complete-typescript-course` and then run/ import the `.sql` files |
| 13 | +1. you need to install PostgreSQL and then set the following environment variable |
| 14 | + `C:\Program Files\PostgreSQL\10\bin`, |
| 15 | + `C:\Program Files\PostgreSQL\10\lib` |
| 16 | +2. rename `.env-sample` to `.env` in the file the DB connection string need to be updated accoring to your `credentials`. |
| 17 | + ex : `postgres://<YourUserName>:<YourPassword>@localhost:5432/<YourDatabase>` |
| 18 | + |
| 19 | +3. you can find the DB and other details under `src/db` |
| 20 | + create database with the name `complete-typescript-course` and then run/ import the `.sql` files |
21 | 21 |
|
22 | 22 | ## Setup
|
23 | 23 |
|
24 | 24 | clone the repo then goto that directory and run following commands
|
25 | 25 |
|
26 |
| - `npm install` |
| 26 | +`npm install` |
27 | 27 |
|
28 |
| - To transpile .ts files to .js run |
| 28 | +To transpile .ts files to .js run |
29 | 29 |
|
30 |
| - `npm run watch` |
| 30 | +`npm run watch` |
31 | 31 |
|
32 | 32 | To start the Application
|
33 | 33 |
|
34 |
| - `nodemon or npm start` |
| 34 | +`nodemon or npm start` |
35 | 35 |
|
36 | 36 | this will run on port 3000 you can change on config or
|
37 | 37 |
|
38 | 38 | `node server.js -p <PORT>`
|
39 | 39 |
|
| 40 | +## Recommended / Preferred |
40 | 41 |
|
| 42 | +[VSCode](https://code.visualstudio.com/download) |
41 | 43 |
|
42 | 44 | ## Credits to
|
43 |
| -Angular University [complete-typescript-course](https://github.com/angular-university/complete-typescript-course) |
44 |
| - |
45 |
| - |
46 |
| - |
47 |
| - |
48 | 45 |
|
| 46 | +Angular University [complete-typescript-course](https://github.com/angular-university/complete-typescript-course) |
0 commit comments