@@ -50,7 +50,7 @@ Authentication Flow uses `json web tokens` via Passport library - `passport-jwt`
50
50
51
51
## ✨ How to use the code
52
52
53
- > ** Step 1** - Clone the project
53
+ > 👉 ** Step 1** - Clone the project
54
54
55
55
``` bash
56
56
$ git clone https://github.com/app-generator/api-server-nodejs.git
@@ -59,7 +59,7 @@ $ cd api-server-nodejs
59
59
60
60
<br />
61
61
62
- > ** Step 2** - Install dependencies via ` Yarn `
62
+ > 👉 ** Step 2** - Install dependencies via ` Yarn `
63
63
64
64
``` bash
65
65
$ npm i
69
69
70
70
<br />
71
71
72
- > ** Step 3** - Run the SQLite migration via TypeORM
72
+ > 👉 ** Step 3** - Run the SQLite migration via TypeORM
73
73
74
74
```
75
75
$ npm run typeorm migration:run
@@ -79,7 +79,7 @@ $ yarn typeorm migration:run
79
79
80
80
<br />
81
81
82
- > ** Step 5 ** - Edit the ` .env ` using the template ` .env.sample ` .
82
+ > 👉 ** Step 4 ** - Edit the ` .env ` using the template ` .env.sample ` .
83
83
84
84
``` env
85
85
PORT=5000 # API PORT
@@ -93,7 +93,7 @@ GITHUB_OAUTH_CLIENT_SECRET= ... # Github OAuth secret
93
93
94
94
<br />
95
95
96
- > ** Step 4 ** - Start the API server (development mode)
96
+ > 👉 ** Step 5 ** - Start the API server (development mode)
97
97
98
98
``` bash
99
99
$ npm run dev
@@ -103,15 +103,15 @@ $ yarn dev
103
103
104
104
<br />
105
105
106
- > ** Step 5 ** - Production Build (files generated in ` build ` directory)
106
+ > 👉 ** Step 6 ** - Production Build (files generated in ` build ` directory)
107
107
108
108
``` bash
109
109
$ yarn build
110
110
```
111
111
112
112
<br />
113
113
114
- > ** Step 6 ** - Start the API server for production (files served from ` build/index.js ` )
114
+ > 👉 ** Step 7 ** - Start the API server for production (files served from ` build/index.js ` )
115
115
116
116
``` bash
117
117
$ yarn start
@@ -157,13 +157,13 @@ The SQLite Path is set in `.env`, as `SQLITE_PATH`
157
157
158
158
## ✨ Database migration
159
159
160
- > Generate migration:
160
+ > 👉 Generate migration:
161
161
162
162
``` bash
163
163
$ yarn typeorm migration:generate -n your_migration_name
164
164
```
165
165
166
- > Run migration:
166
+ > 👉 Run migration:
167
167
168
168
``` bash
169
169
$ yarn typeorm migration:run
@@ -175,7 +175,7 @@ $ yarn typeorm migration:run
175
175
176
176
For a fast set up, use this POSTMAN file: [ api_sample] ( https://github.com/app-generator/api-server-nodejs-pro/blob/master/media/api.postman_collection.json )
177
177
178
- > ** Register** - ` api/users/register `
178
+ > 👉 ** Register** - ` api/users/register `
179
179
180
180
```
181
181
POST api/users/register
@@ -190,7 +190,7 @@ Content-Type: application/json
190
190
191
191
<br />
192
192
193
- > ** Login** - ` api/users/login `
193
+ > 👉 ** Login** - ` api/users/login `
194
194
195
195
```
196
196
POST /api/users/login
@@ -204,7 +204,7 @@ Content-Type: application/json
204
204
205
205
<br />
206
206
207
- > ** Logout** - ` api/users/logout `
207
+ > 👉 ** Logout** - ` api/users/logout `
208
208
209
209
```
210
210
POST api/users/logout
@@ -220,11 +220,13 @@ authorization: JWT_TOKEN (returned by Login request)
220
220
221
221
## ✨ Update role for existing user
222
222
223
- Using npm:
223
+ > 👉 Using npm:
224
224
225
225
``` npm run update-role [user_id] [role_id (optional)] ```
226
226
227
- Using yarn:
227
+ <br />
228
+
229
+ > 👉 Using yarn:
228
230
229
231
``` npm run update-role [user_id] [role_id (optional)] ```
230
232
0 commit comments