Files
blog-service/backend/src/index.ts
T

24 lines
617 B
TypeScript
Raw Normal View History

2025-11-14 17:40:10 -06:00
import 'dotenv/config';
2025-12-26 22:08:51 -06:00
import express, { Response } from 'express';
import { articlesRouter } from './routes/articles.ts';
import { blocksRouter } from './routes/blocks.ts';
import { imagesRouter } from './routes/images.ts';
2025-11-14 17:40:10 -06:00
const app = express();
2025-11-23 23:35:41 -06:00
app.use(express.json());
2025-11-14 17:40:10 -06:00
2025-12-26 22:08:51 -06:00
app.get("/status", (_, res: Response) => {
2025-11-23 23:35:41 -06:00
res.json({ message: "Backend Operational" });
});
2025-12-26 22:08:51 -06:00
app.use("/articles", articlesRouter);
app.use("/blocks", blocksRouter);
app.use("/images", imagesRouter);
2025-11-23 23:35:41 -06:00
2025-12-26 22:08:51 -06:00
const port = process.env.PORT || 3000;
2025-11-23 23:35:41 -06:00
2025-11-14 17:40:10 -06:00
app.listen(port, () => {
console.log(`The server is running at http://localhost:${port}`);
});