UNPKG

ts-express-eslint-prettier

Version:

A TypeScript + Express backend starter with ESLint and Prettier configuration.

23 lines (22 loc) 728 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const express_1 = __importDefault(require("express")); const cors_1 = __importDefault(require("cors")); const dotenv_1 = __importDefault(require("dotenv")); dotenv_1.default.config(); const app = (0, express_1.default)(); const PORT = process.env.PORT || 5000; // Middleware app.use((0, cors_1.default)()); app.use(express_1.default.json()); // Routes app.get('/', (req, res) => { const a = 30; res.send(a); }); app.listen(PORT, () => { console.log(`Server running on http://localhost:${PORT}`); });