Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
Added discovery endpoint stub (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiancross authored Apr 15, 2021
1 parent 01f00fd commit 23f7b59
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions packages/backend-federation-server/src/discovery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* CS3099 Group A3
*/

import { AsyncRouter } from "express-async-router";
import { ResponseError } from "./response-error";

const router = AsyncRouter();

router.get("/", () => {
throw new ResponseError(501, "Not implemented");
});

export { router as routes };
2 changes: 2 additions & 0 deletions packages/backend-federation-server/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

import { Router } from "express";
import { routes as discoveryRoutes } from "./discovery";
import { routes as communityRoutes } from "./communities";
import { routes as postRoutes } from "./posts";
import { routes as userRoutes } from "./users";
Expand All @@ -12,5 +13,6 @@ const router: Router = Router();
router.use("/communities", communityRoutes);
router.use("/posts", postRoutes);
router.use("/users", userRoutes);
router.use("/discover", discoveryRoutes);

export const routes = router;
4 changes: 2 additions & 2 deletions packages/backend-federation-server/src/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ router.get("/", async (req, res) => {
});

router.get("/:id", () => {
throw new ResponseError(500, "Not implemented");
throw new ResponseError(501, "Not implemented");
});

router.post("/:id", () => {
throw new ResponseError(500, "Not implemented");
throw new ResponseError(501, "Not implemented");
});

export { router as routes };

0 comments on commit 23f7b59

Please sign in to comment.