import express from 'express';
import locations from './routes/locations';
import tripLocations from './routes/trip-locations';
import distances from './routes/distances';
import admin from './routes/admin';

const router = express.Router();

router.route( '/secured/locations' )
.get( locations.list )
.post( locations.create )
.put( locations.updateList );

router.route( '/secured/locations/:locationId' )
.get( locations.get )
.put( locations.update )
.delete( locations.delete );

router.route( '/secured/trip-locations' )
.get( tripLocations.list )
.delete( tripLocations.deleteAll )
.put( tripLocations.updateList );

router.route( '/secured/distance' )
.get( distances.get );

router.route( '/secured/distances' )
.post( distances.post );

router.route( '/admin/events' )
.get( admin.get );

export default router;

import express from 'express';
import locations from './routes/locations';
import tripLocations from './routes/trip-locations';
import distances from './routes/distances';
import admin from './routes/admin';

const router = express.Router();

router.route( '/ping' )
.get( ( req, res ) => {
  res.status( 200 ).json( { ping: 'pong' } );
} );

router.route( '/secured/locations' )
.get( locations.list )
.post( locations.create )
.put( locations.updateList );

router.route( '/secured/locations/:locationId' )
.get( locations.get )
.put( locations.update )
.delete( locations.delete );

router.route( '/secured/trip-locations' )
.get( tripLocations.list )
.delete( tripLocations.deleteAll )
.put( tripLocations.updateList );

router.route( '/secured/distance' )
.get( distances.get );

router.route( '/secured/distances' )
.post( distances.post );

router.route( '/admin/events' )
.get( admin.get );

export default router;

Add ping route for testing
Add ping route for testing
