mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-07 07:58:53 -05:00
16 lines
473 B
TypeScript
16 lines
473 B
TypeScript
import type { Express } from "express";
|
|
import { createServer, type Server } from "http";
|
|
import { storage } from "./storage";
|
|
|
|
export async function registerRoutes(app: Express): Promise<Server> {
|
|
// put application routes here
|
|
// prefix all routes with /api
|
|
|
|
// use storage to perform CRUD operations on the storage interface
|
|
// e.g. storage.insertUser(user) or storage.getUserByUsername(username)
|
|
|
|
const httpServer = createServer(app);
|
|
|
|
return httpServer;
|
|
}
|