Skip to content

Commit

Permalink
Added facilities
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-vasconcelos committed Dec 11, 2023
1 parent 76ec924 commit 0e7a477
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/endpoints/facilities.endpoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* * */

const AVAILABLE_FACILITIES = ['schools', 'encm'];

/* * */

module.exports.all = async (request, reply) => {
return reply.code(200).header('Content-Type', 'application/json; charset=utf-8').send(JSON.stringify(AVAILABLE_FACILITIES));
};
3 changes: 3 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const vehiclesEndpoint = require('./endpoints/vehicles.endpoint');

// IMPORT DATASETS ENDPOINTS

const facilitiesEndpoint = require('./endpoints/facilities.endpoint');
const schoolsEndpoint = require('./endpoints/schools.endpoint');
const encmEndpoint = require('./endpoints/encm.endpoint');

Expand Down Expand Up @@ -75,6 +76,8 @@ fastify.get('/vehicles.pb', vehiclesEndpoint.protobuf);

// DATASETS ENDPOINTS

fastify.get('/facilities', facilitiesEndpoint.all);

fastify.get('/facilities/schools', schoolsEndpoint.all);
fastify.get('/facilities/schools/:id', schoolsEndpoint.single);

Expand Down

0 comments on commit 0e7a477

Please sign in to comment.