I am creating an app with express, next and ace (atlassian-connect-express).
Express + next requires me to use routes like this:
app.all('*', (req, res) => {
return handle(req, res)
})
But I need special behavior for an atlassian-connect.json. In the ace example, it is done like this:
app.get('/', (_, res) => {
res.redirect('/atlassian-connect.json');
})
The problem with that is that the first route will still be used for /atlassian-connect.json, so I have to overwrite that as well.
But if I try it manually like this, I run into the following problem:
app.get('/atlassian-connect.json', (_, res) => {
let content = fs.readFileSync(path.resolve('atlassian-connect.json'));
let json = JSON.parse(content);
res.send(json)
})
The json contains a part like this:
"baseUrl": "{{localBaseUrl}}"
And the localBaseUrl gets automatically filled out if I dont have a manual route for /atlassian-connect.json. When I do use my route, it doesn't fill it out. How can I fill it out?