File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,15 @@ gateway({
9
9
10
10
routes : [ {
11
11
prefix : '/public' ,
12
- target : 'http://public.myapp:300 ' ,
12
+ target : 'http://localhost:3000 ' ,
13
13
docs : {
14
14
name : 'Public Service' ,
15
15
endpoint : 'swagger.json' ,
16
16
type : 'swagger'
17
17
}
18
18
} , {
19
19
prefix : '/admin' ,
20
- target : 'http://admin.myapp:3000 ' ,
20
+ target : 'http://localhost:3001 ' ,
21
21
middlewares : [
22
22
require ( 'express-jwt' ) ( {
23
23
secret : 'shhhhhhared-secret'
@@ -27,3 +27,13 @@ gateway({
27
27
} ) . start ( PORT ) . then ( server => {
28
28
console . log ( `API Gateway listening on ${ PORT } port!` )
29
29
} )
30
+
31
+ const service1 = require ( 'restana' ) ( { } )
32
+ service1
33
+ . get ( '/hi' , ( req , res ) => res . send ( 'Hello World!' ) )
34
+ . start ( 3000 ) . then ( ( ) => console . log ( 'Public service listening on 3000 port!' ) )
35
+
36
+ const service2 = require ( 'restana' ) ( { } )
37
+ service2
38
+ . get ( '/users' , ( req , res ) => res . send ( [ ] ) )
39
+ . start ( 3001 ) . then ( ( ) => console . log ( 'Admin service listening on 3001 port!' ) )
You can’t perform that action at this time.
0 commit comments