UNPKG

nim-nodex-init

Version:

nim-nodex-init is a powerful CLI tool that scaffolds a complete Node.js & Express.js app with your preferred database, ORM, authentication system, and organized folder structure — all in seconds.

24 lines (17 loc) 517 B
import express from "express"; import dotenv from "dotenv"; import bodyParser from "body-parser"; import cors from "cors"; dotenv.config(); const app = express(); //cors middleware app.use(cors()); //body parser middleware app.use(bodyParser.json()); //json middleware app.use(express.json()); app.use(express.urlencoded({ extended: true })); //static public folder app.use(express.static("public")); const PORT = process.env.PORT || 5000; app.listen(PORT, () => console.log(`Server running on port ${PORT}`));