Last active
December 2, 2019 17:46
-
-
Save jkyberneees/561d81120e83b404ff8ed77490e79d6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gateway = require('fast-gateway') | |
const PORT = process.env.PORT || 8080 | |
gateway({ | |
middlewares: [ | |
require('cors')(), | |
require('helmet')() | |
], | |
routes: [{ | |
prefix: '/public', | |
target: 'http://public.myapp:300' | |
}, { | |
prefix: '/admin', | |
target: 'http://admin.myapp:3000', | |
middlewares: [ | |
require('express-jwt')({ | |
secret: 'shhhhhhared-secret' | |
}) | |
] | |
}] | |
}).start(PORT).then(server => { | |
console.log(`API Gateway listening on ${PORT} port!`) | |
}) |
Hola @gvalmana, si, hablo español. Te decía que si puedes pegar aquí el código donde usas fast-gateway. Me ayudaría a entender donde está el problema en tu lado.
Saludos
Bien el ejemplo que estoy usando es ese mismo que tienes puesto, lo unico que hice fue cambiar el target de la ruta
{
prefix: '/public',
target: 'http://public.myapp:300'
},
a
{
prefix: '/public',
target: 'http://localhost/micro-app/web/index.php?r=estudiante/'
},
y sea la ruta que ponga en el prefix, me dice que esa ruta no existe, tengo una duda, debo usar express para crear las rutas en mi app?
@gvalmana revisa si tu localhost no requieres algun puerto, o intenta poner localhost:80/micro....
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hola @gvalmana, si, hablo español. Te decía que si puedes pegar aquí el código donde usas fast-gateway. Me ayudaría a entender donde está el problema en tu lado.
Saludos