Hello, I’m noob in kong.
I have some question for Kong Service.
I’ve installed kong in docker and add two api Services,Routes
- host url : https://jsonplaceholder.typicode.com/ , kong service path : /fakejson
route method : get
as you know, ‘jsonplaceholder.typicode.com/’ serve fake json data.
when I call localhost:8000/fakejson/users, it works.
- host url : ( host.docker.internal or docker.for.mac.host.internal or my global IP / I’ve tried all)
. kong service path : /local
route method : get
I’ve run the rest api server(node.js) in local env and I can get right response by direct call
when I use Kong api call, It doesn’t work.
I attached the node server code.
////////////////////////////////////////////////////
var express = require(‘express’);
var app = express();
app.get(’/test1’, function (req, res) {
var samplejson = [{‘hello’ : ‘world’}];
res.send(samplejson);
});
app.get(’/test1/1’, function (req, res) {
var samplejson = {‘hello1’ : ‘world1’};
res.send(samplejson);
});
// Port setting
var port = 34421;
app.listen(port, function(){
console.log(‘server on! http://localhost:’+port);
});
/////////////////////////////////////////////////////////////
Could someone answer me??