Skip to content

Commit

Permalink
Adding api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pqvst committed Apr 15, 2024
1 parent cebd8b2 commit 1105ace
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ for (const locale of i18n.getLocales()) {
});
});

app.get(`${prefix}/api/${city.id}.json`, (req, res) => {
res.json(city);
});

for (const redirect of city.redirects) {
app.get(`${prefix}/${city.id}/${encodeURI(redirect.id)}`, redirectWithTrailingSlash);
app.get(`${prefix}/${city.id}/${encodeURI(redirect.id)}/`, (req, res) => {
Expand Down

0 comments on commit 1105ace

Please sign in to comment.