UNPKG

wayone

Version:

A simple Node.js package that helps you install express and other dependency packages for a simple express api with a defined folder structrure

16 lines (12 loc) 338 B
const express = require('express'); const app = express(); const v1Routes = require('./routes/v1'); // Middleware app.use(express.json()); // Initialize v1 routes app.use('/api/v1', v1Routes); // Start the server const PORT = process.env.PORT || 3000; app.listen(PORT, () => { console.log(`Server is running on port ${PORT}`); });