Viewing File: /home/ubuntu/efiexchange-node-base/src/routes/cryptoExchange.routes.ts
import express, { Request, Response, NextFunction } from "express";
import { getSymbolsList } from "src/controllers/exchange";
const Route = express.Router();
const asyncHandler =
(fn: (req: Request, res: Response, next: NextFunction) => Promise<void>) =>
(req: Request, res: Response, next: NextFunction) => {
Promise.resolve(fn(req, res, next)).catch(next);
};
// Base route
Route.get("/", (req: Request, res: Response) => {
res.sendResponse({ key: "Exchange Symbol Routes" }, "Exchange symbol routes");
});
// Symbols-related routes
Route.get("/symbols", asyncHandler(getSymbolsList));
export default Route;
Back to Directory
File Manager