36 lines
979 B
JavaScript
36 lines
979 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:3502",
|
||
|
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-26 12:00:00",
|
||
|
groupName: "GroupHAHAHA222",
|
||
|
},
|
||
|
],
|
||
|
};
|
||
|
});
|
||
|
|
||
|
// Run the server!
|
||
|
const start = async () => {
|
||
|
try {
|
||
|
await fastify.listen(3502);
|
||
|
} catch (err) {
|
||
|
fastify.log.error(err);
|
||
|
process.exit(1);
|
||
|
}
|
||
|
};
|
||
|
start();
|