create-backend-jerrie
Version:
CLI tool to create Node.js + TypeScript backend with folder structure
20 lines (14 loc) • 442 B
text/typescript
import express, { Application, Request, Response } from 'express';
import cors from 'cors';
import dotenv from 'dotenv';
dotenv.config();
const app: Application = express();
const PORT = process.env.PORT || 5000;
app.use(cors());
app.use(express.json());
app.get('/', (req: Request, res: Response) => {
res.json({ message: 'Welcome to Backend API!' });
});
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});