HSG-MCS-HS21_tapas/mocks/auction-house/discoveryEndpoint.js

36 lines
971 B
JavaScript

// Require the framework and instantiate it
const fastify = require("fastify")({ logger: true });
// Declare a route
fastify.get("/discovery/", async (request, reply) => {
return {
auctionHouseInfo: [
{
auctionHouseURI: "http://localhost:3500",
webSubURI: "http://example.org",
taskTypes: ["COMPUTATION", "RANDOMTEXT"],
timeStamp: "2021-12-24 12:00:00",
groupName: "Group3",
},
{
auctionHouseURI: "http://localhost:3501",
webSubURI: "http://facemash.com",
taskTypes: ["BIGROBOT"],
timeStamp: "2021-12-24 12:00:00",
groupName: "Group2",
},
],
};
});
// Run the server!
const start = async () => {
try {
await fastify.listen(3500);
} catch (err) {
fastify.log.error(err);
process.exit(1);
}
};
start();