1.1.2 • Published 6 months ago
basic-backend-server v1.1.2
Express Server
This is a simple Express server package to help you quickly set up and run a server for your web applications.
Installation
To install the package, use npm:
npm i basic-backend-server
Usage
Here is a basic example of how to use the Express Server package:
import express from "express";
import dotenv from "dotenv";
// dot env configuration
dotenv.config();
// constants
const PORT = process.env.PORT;
const app = express();
// routes
app.get("/", (req, res) => {
res.status(200).send("Server is running properly. 😊");
});
// server listing
app.listen(PORT, () => {
console.log(`Server is running at http://localhost:${PORT}`);
});
Features
- Easy to set up and use
- Supports middleware
- Handles routing
- Environment variable support
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License.