Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a903f6a

Browse files
author
Ivan Franchin
committed
Update README file
1 parent e340d95 commit a903f6a

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

‎README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
6262
- In a terminal, make sure you are inside the `springboot-react-basic-auth` root folder;
6363

6464
- Run the following command to start docker compose containers:
65-
```
65+
```bash
6666
docker compose up -d
6767
```
6868

@@ -73,7 +73,7 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
7373
- Open a terminal and navigate to the `springboot-react-basic-auth/book-api` folder;
7474

7575
- Run the following `Maven` command to start the application:
76-
```
76+
```bash
7777
./mvnw clean spring-boot:run
7878
```
7979

@@ -82,12 +82,12 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
8282
- Open another terminal and navigate to the `springboot-react-basic-auth/book-ui` folder;
8383

8484
- Run the command below if you are running the application for the first time:
85-
```
85+
```bash
8686
npm install
8787
```
8888

8989
- Run the `npm` command below to start the application:
90-
```
90+
```bash
9191
npm start
9292
```
9393

@@ -127,31 +127,31 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
127127
- Open a terminal:
128128

129129
- Call `GET /public/numberOfBooks`:
130-
```
130+
```bash
131131
curl -i localhost:8080/public/numberOfBooks
132132
```
133133
It should return
134-
```
134+
```text
135135
HTTP/1.1 200
136136
70
137137
```
138138

139139
- Call `GET /api/books` without credentials:
140-
```
140+
```bash
141141
curl -i localhost:8080/api/books
142142
```
143143
As this endpoint requires authentication, it should return:
144-
```
144+
```text
145145
HTTP/1.1 401
146146
{ "timestamp": "...", "status": 401, "error": "Unauthorized", "message": "Unauthorized", "path": "/api/books" }
147147
```
148148
149149
- Call again `GET /api/books` but now with `user` credentials:
150-
```
150+
```bash
151151
curl -i -u user:user localhost:8080/api/books
152152
```
153153
It should return:
154-
```
154+
```text
155155
HTTP/1.1 200
156156
[
157157
{"isbn":"978-1-60309-445-0","title":"A Shining Beacon"},
@@ -161,23 +161,23 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
161161
```
162162
163163
- Call `POST /api/books` with `user` credentials:
164-
```
164+
```bash
165165
curl -i -u user:user -X POST localhost:8080/api/books \
166166
-H "Content-Type: application/json" -d '{"isbn": "9781617292545", "title": "Spring Boot in Action"}'
167167
```
168168
As `user` doesn't have the role `ADMIN`, it should return:
169-
```
169+
```text
170170
HTTP/1.1 403
171171
{ "timestamp": "...", "status": 403, "error": "Forbidden", "message": "Forbidden", "path": "/api/books" }
172172
```
173173
174174
- Call `POST /api/books` with `admin` credentials:
175-
```
175+
```bash
176176
curl -i -u admin:admin -X POST localhost:8080/api/books \
177177
-H "Content-Type: application/json" -d '{"isbn": "9781617292545", "title": "Spring Boot in Action"}'
178178
```
179179
It should return:
180-
```
180+
```text
181181
HTTP/1.1 201
182182
{ "isbn":"9781617292545","title":"Spring Boot in Action" }
183183
```
@@ -187,11 +187,11 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
187187
- Open a terminal and make sure you are in the `springboot-react-basic-auth` root folder;
188188
189189
- Run the following script:
190-
```
190+
```bash
191191
./book-api/test-endpoints.sh
192192
```
193193
It should return something like the output below, where it shows the http code for different requests:
194-
```
194+
```text
195195
POST auth/authenticate
196196
======================
197197
admin Auth Resp: {"id":1,"name":"Admin","role":"ADMIN"}
@@ -226,7 +226,7 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
226226
## Util Commands
227227
228228
- **Postgres**
229-
```
229+
```bash
230230
docker exec -it postgres psql -U postgres -d bookdb
231231
\dt
232232
```
@@ -236,7 +236,7 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
236236
- To stop `book-api` and `book-ui`, go to the terminals where they are running and press `Ctrl+C`;
237237
238238
- To stop and remove Docker Compose containers, network, and volumes, go to a terminal and, inside the `springboot-react-basic-auth` root folder, run the command below:
239-
```
239+
```bash
240240
docker compose down -v
241241
```
242242
@@ -245,7 +245,7 @@ On [ivangfr.github.io](https://ivangfr.github.io), I have compiled my Proof-of-C
245245
- In a terminal, make sure you are in the `springboot-react-basic-auth/book-ui` folder;
246246
247247
- Run the following commands:
248-
```
248+
```bash
249249
npm upgrade
250250
npm i -g npm-check-updates
251251
ncu -u

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /