added ahCrawler and finished discovery endpoint

This commit is contained in:
2021-12-06 03:32:15 +01:00
parent ec26b84dc9
commit 560f1ff34b
15 changed files with 647 additions and 102 deletions

View File

@@ -0,0 +1,35 @@
// 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:3501",
webSubURI: "http://example.org",
taskTypes: ["COMPUTATION", "RANDOMTEXT"],
timeStamp: "2021-12-24 12:00:00",
groupName: "Group3",
},
{
auctionHouseURI: "http://localhost:3502",
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(3501);
} catch (err) {
fastify.log.error(err);
process.exit(1);
}
};
start();

View File

@@ -0,0 +1,35 @@
// 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();

View File

@@ -0,0 +1,35 @@
// 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();