├── .env ├── .gitignore ├── README.md ├── tsconfig.json ├── src └── index.ts └── package.json /.env: -------------------------------------------------------------------------------- 1 | PORT=8000 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Express Js With Typescript Starter KIT 🙌 2 | 3 | ## After cloning run the below command to run the project 4 | 5 | ```js 6 | npm install && npm run dev 7 | ``` 8 | 9 | **Now All Set you can open below url to see your page** 10 | 11 | ```js 12 | http://localhost:8000 13 | ``` 14 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "NodeNext", 5 | "strict": true, 6 | "verbatimModuleSyntax": true, 7 | "skipLibCheck": true, 8 | "types": ["node"], 9 | "rootDir": "src", 10 | "outDir": "dist", 11 | "jsx": "react-jsx", 12 | "allowSyntheticDefaultImports": true, 13 | "esModuleInterop": true 14 | }, 15 | "include": ["src/**/*"], 16 | "exclude": ["node_modules", "dist", ".build"] 17 | } 18 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import express from "express"; 2 | import type { Application, Request, Response } from "express"; 3 | import "dotenv/config"; 4 | import cors from "cors"; 5 | const app: Application = express(); 6 | const PORT = process.env.PORT || 7000; 7 | 8 | // * Middleware 9 | app.use(cors()); 10 | app.use(express.json()); 11 | app.use(express.urlencoded({ extended: false })); 12 | 13 | app.get("/", (req: Request, res: Response) => { 14 | return res.send("It's working 🙌"); 15 | }); 16 | 17 | app.listen(PORT, () => console.log(`Server is running on PORT ${PORT}`)); 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "express_ts", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "type": "module", 6 | "scripts": { 7 | "build": "tsc", 8 | "start": "node dist/index.js", 9 | "watch": "tsc -w", 10 | "dev": "tsx watch src/index.ts" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "description": "", 16 | "devDependencies": { 17 | "@types/cors": "^2.8.19", 18 | "@types/express": "^5.0.3", 19 | "@types/node": "^24.3.0", 20 | "concurrently": "^9.2.0", 21 | "nodemon": "^3.1.10", 22 | "tsx": "^4.20.4", 23 | "typescript": "^5.9.2" 24 | }, 25 | "dependencies": { 26 | "cors": "^2.8.5", 27 | "dotenv": "^17.2.1", 28 | "express": "^5.1.0" 29 | } 30 | } 31 | --------------------------------------------------------------------------------