1
1
window . onload = ( ) => {
2
2
// microservice1 - Books
3
3
const microservicePort = {
4
- 3000 : 'Frontend' ,
4
+ 3333 : 'Frontend' ,
5
5
8888 : 'Books' ,
6
6
7777 : 'Orders' ,
7
7
5555 : 'Customers' ,
@@ -37,7 +37,7 @@ window.onload = () => {
37
37
} ;
38
38
39
39
book = JSON . stringify ( book ) ;
40
- fetch ( 'http://localhost:8080 /books/createbook' , {
40
+ fetch ( 'http://localhost:8000 /books/createbook' , {
41
41
method : 'POST' ,
42
42
headers : { 'Content-Type' : 'application/json' } ,
43
43
body : book ,
@@ -60,7 +60,7 @@ window.onload = () => {
60
60
newDisplay . id = 'display' ;
61
61
newDisplay . innerHTML = 'List of books' ;
62
62
document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
63
- fetch ( 'http://localhost:8080 /books/getbooks' , {
63
+ fetch ( 'http://localhost:8000 /books/getbooks' , {
64
64
method : 'GET' ,
65
65
} )
66
66
. then ( res => res . json ( ) )
@@ -85,7 +85,7 @@ window.onload = () => {
85
85
const newDisplay = document . createElement ( 'ul' ) ;
86
86
newDisplay . id = 'display' ;
87
87
document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
88
- const url = new URL ( 'http://localhost:8080 /books/deletebook:id?' ) ;
88
+ const url = new URL ( 'http://localhost:8000 /books/deletebook:id?' ) ;
89
89
// const url = new URL('http://localhost:3000/books/deletebook:id?');
90
90
url . searchParams . append ( 'id' , bookInDb . _id ) ;
91
91
@@ -115,7 +115,7 @@ window.onload = () => {
115
115
newDisplay . id = 'display' ;
116
116
newDisplay . innerHTML = 'List of orders' ;
117
117
document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
118
- fetch ( 'http://localhost:8080 /books/getordersinfo' , {
118
+ fetch ( 'http://localhost:8000 /books/getordersinfo' , {
119
119
method : 'GET' ,
120
120
} )
121
121
. then ( res => res . json ( ) )
@@ -149,7 +149,7 @@ window.onload = () => {
149
149
address,
150
150
} ;
151
151
customer = JSON . stringify ( customer ) ;
152
- fetch ( 'http://localhost:8080 /customers/createcustomer' , {
152
+ fetch ( 'http://localhost:8000 /customers/createcustomer' , {
153
153
method : 'POST' ,
154
154
headers : { 'Content-Type' : 'application/json' } ,
155
155
body : customer ,
@@ -170,7 +170,7 @@ window.onload = () => {
170
170
newDisplay . id = 'display' ;
171
171
newDisplay . innerHTML = 'List of customers' ;
172
172
document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
173
- fetch ( 'http://localhost:8080 /customers/getcustomers' , {
173
+ fetch ( 'http://localhost:8000 /customers/getcustomers' , {
174
174
method : 'GET' ,
175
175
} )
176
176
. then ( res => res . json ( ) )
@@ -191,7 +191,7 @@ window.onload = () => {
191
191
const newDisplay = document . createElement ( 'ul' ) ;
192
192
newDisplay . id = 'display' ;
193
193
document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
194
- const url = new URL ( 'http://localhost:8080 /customers/deletecustomer:id?' ) ;
194
+ const url = new URL ( 'http://localhost:8000 /customers/deletecustomer:id?' ) ;
195
195
url . searchParams . append ( 'id' , customerInDb . _id ) ;
196
196
fetch ( url , {
197
197
method : 'DELETE' ,
@@ -218,7 +218,7 @@ window.onload = () => {
218
218
newDisplay . innerHTML = 'List of books' ;
219
219
document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
220
220
221
- fetch ( 'http://localhost:8080 /customers/getbooksinfo' , {
221
+ fetch ( 'http://localhost:8000 /customers/getbooksinfo' , {
222
222
method : 'GET' ,
223
223
} )
224
224
. then ( res => res . json ( ) )
@@ -254,7 +254,7 @@ window.onload = () => {
254
254
deliveryDate,
255
255
} ;
256
256
order = JSON . stringify ( order ) ;
257
- fetch ( 'http://localhost:8080 /orders/createorder' , {
257
+ fetch ( 'http://localhost:8000 /orders/createorder' , {
258
258
method : 'POST' ,
259
259
headers : { 'Content-Type' : 'application/json' } ,
260
260
body : order ,
@@ -276,7 +276,7 @@ window.onload = () => {
276
276
newDisplay . id = 'display' ;
277
277
newDisplay . innerHTML = 'List of orders' ;
278
278
document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
279
- fetch ( 'http://localhost:8080 /orders/getorders' , {
279
+ fetch ( 'http://localhost:8000 /orders/getorders' , {
280
280
method : 'GET' ,
281
281
} )
282
282
. then ( res => res . json ( ) )
@@ -297,7 +297,7 @@ window.onload = () => {
297
297
const newDisplay = document . createElement ( 'ul' ) ;
298
298
newDisplay . id = 'display' ;
299
299
document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
300
- const url = new URL ( 'http://localhost:8080 /orders/deleteorder:id?' ) ;
300
+ const url = new URL ( 'http://localhost:8000 /orders/deleteorder:id?' ) ;
301
301
url . searchParams . append ( 'id' , orderInDb . _id ) ;
302
302
fetch ( url , {
303
303
method : 'DELETE' ,
@@ -323,7 +323,7 @@ window.onload = () => {
323
323
newDisplay . innerHTML = 'List of customers' ;
324
324
document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
325
325
326
- fetch ( 'http://localhost:8080 /orders/getcustomersinfo' , {
326
+ fetch ( 'http://localhost:8000 /orders/getcustomersinfo' , {
327
327
method : 'GET' ,
328
328
} )
329
329
. then ( res => res . json ( ) )
0 commit comments