11window . onload = ( ) => {
22 // microservice1 - Books
33 const microservicePort = {
4- 3000 : 'Frontend' ,
4+ 3333 : 'Frontend' ,
55 8888 : 'Books' ,
66 7777 : 'Orders' ,
77 5555 : 'Customers' ,
@@ -37,7 +37,7 @@ window.onload = () => {
3737 } ;
3838
3939 book = JSON . stringify ( book ) ;
40- fetch ( 'http://localhost:8080 /books/createbook' , {
40+ fetch ( 'http://localhost:8000 /books/createbook' , {
4141 method : 'POST' ,
4242 headers : { 'Content-Type' : 'application/json' } ,
4343 body : book ,
@@ -60,7 +60,7 @@ window.onload = () => {
6060 newDisplay . id = 'display' ;
6161 newDisplay . innerHTML = 'List of books' ;
6262 document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
63- fetch ( 'http://localhost:8080 /books/getbooks' , {
63+ fetch ( 'http://localhost:8000 /books/getbooks' , {
6464 method : 'GET' ,
6565 } )
6666 . then ( res => res . json ( ) )
@@ -85,7 +85,7 @@ window.onload = () => {
8585 const newDisplay = document . createElement ( 'ul' ) ;
8686 newDisplay . id = 'display' ;
8787 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?' ) ;
8989 // const url = new URL('http://localhost:3000/books/deletebook:id?');
9090 url . searchParams . append ( 'id' , bookInDb . _id ) ;
9191
@@ -115,7 +115,7 @@ window.onload = () => {
115115 newDisplay . id = 'display' ;
116116 newDisplay . innerHTML = 'List of orders' ;
117117 document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
118- fetch ( 'http://localhost:8080 /books/getordersinfo' , {
118+ fetch ( 'http://localhost:8000 /books/getordersinfo' , {
119119 method : 'GET' ,
120120 } )
121121 . then ( res => res . json ( ) )
@@ -149,7 +149,7 @@ window.onload = () => {
149149 address,
150150 } ;
151151 customer = JSON . stringify ( customer ) ;
152- fetch ( 'http://localhost:8080 /customers/createcustomer' , {
152+ fetch ( 'http://localhost:8000 /customers/createcustomer' , {
153153 method : 'POST' ,
154154 headers : { 'Content-Type' : 'application/json' } ,
155155 body : customer ,
@@ -170,7 +170,7 @@ window.onload = () => {
170170 newDisplay . id = 'display' ;
171171 newDisplay . innerHTML = 'List of customers' ;
172172 document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
173- fetch ( 'http://localhost:8080 /customers/getcustomers' , {
173+ fetch ( 'http://localhost:8000 /customers/getcustomers' , {
174174 method : 'GET' ,
175175 } )
176176 . then ( res => res . json ( ) )
@@ -191,7 +191,7 @@ window.onload = () => {
191191 const newDisplay = document . createElement ( 'ul' ) ;
192192 newDisplay . id = 'display' ;
193193 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?' ) ;
195195 url . searchParams . append ( 'id' , customerInDb . _id ) ;
196196 fetch ( url , {
197197 method : 'DELETE' ,
@@ -218,7 +218,7 @@ window.onload = () => {
218218 newDisplay . innerHTML = 'List of books' ;
219219 document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
220220
221- fetch ( 'http://localhost:8080 /customers/getbooksinfo' , {
221+ fetch ( 'http://localhost:8000 /customers/getbooksinfo' , {
222222 method : 'GET' ,
223223 } )
224224 . then ( res => res . json ( ) )
@@ -254,7 +254,7 @@ window.onload = () => {
254254 deliveryDate,
255255 } ;
256256 order = JSON . stringify ( order ) ;
257- fetch ( 'http://localhost:8080 /orders/createorder' , {
257+ fetch ( 'http://localhost:8000 /orders/createorder' , {
258258 method : 'POST' ,
259259 headers : { 'Content-Type' : 'application/json' } ,
260260 body : order ,
@@ -276,7 +276,7 @@ window.onload = () => {
276276 newDisplay . id = 'display' ;
277277 newDisplay . innerHTML = 'List of orders' ;
278278 document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
279- fetch ( 'http://localhost:8080 /orders/getorders' , {
279+ fetch ( 'http://localhost:8000 /orders/getorders' , {
280280 method : 'GET' ,
281281 } )
282282 . then ( res => res . json ( ) )
@@ -297,7 +297,7 @@ window.onload = () => {
297297 const newDisplay = document . createElement ( 'ul' ) ;
298298 newDisplay . id = 'display' ;
299299 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?' ) ;
301301 url . searchParams . append ( 'id' , orderInDb . _id ) ;
302302 fetch ( url , {
303303 method : 'DELETE' ,
@@ -323,7 +323,7 @@ window.onload = () => {
323323 newDisplay . innerHTML = 'List of customers' ;
324324 document . getElementById ( 'container' ) . appendChild ( newDisplay ) ;
325325
326- fetch ( 'http://localhost:8080 /orders/getcustomersinfo' , {
326+ fetch ( 'http://localhost:8000 /orders/getcustomersinfo' , {
327327 method : 'GET' ,
328328 } )
329329 . then ( res => res . json ( ) )
0 commit comments