Skip to content

Commit

Permalink
fix: move isochrones endpoint back to /
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Sep 21, 2018
1 parent ac3540b commit 66390bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
map.on('load', () => {
map.on('click', (event) => {
const { lngLat: { lat, lng } } = event;
fetch(`/isochrones?lat=${lat}&lng=${lng}`)
fetch(`/?lat=${lat}&lng=${lng}`)
.then(response => response.json())
.then((response) => {
map.getSource('isochrones').setData(response);
Expand Down
6 changes: 3 additions & 3 deletions src/router.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const Router = require('koa-router');

const index = require('./routes/index');
const debug = require('./routes/debug');
const tiles = require('./routes/tiles');
const isochrones = require('./routes/isochrones');

const router = new Router();

router.get('/', index);
router.get('/isochrones', isochrones);
router.get('/', isochrones);
router.get('/debug', debug);
router.get('/tiles/:z(\\d+)/:x(\\d+)/:y(\\d+).pbf', tiles);

module.exports = router;
File renamed without changes.
2 changes: 1 addition & 1 deletion test/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const points = [[7.41337, 43.72956], [7.41546, 43.73077], [7.41862, 43.73216]];
test.each(points)('isochrone(%f, %f)', async (lng, lat) => {
try {
const response = await request(app)
.get(`/isochrones?lng=${lng}&lat=${lat}`)
.get(`/?lng=${lng}&lat=${lat}`)
.expect(200)
.expect('Content-Type', /json/);
const errors = geojsonhint.hint(response.text);
Expand Down

0 comments on commit 66390bc

Please sign in to comment.