18 lines
459 B
JavaScript
Executable File
18 lines
459 B
JavaScript
Executable File
// Load environment variables from .env file
|
|
require("dotenv").config();
|
|
|
|
// Import the Express application from src/app.js
|
|
const app = require("./src/app");
|
|
|
|
// Get the port from the environment variables
|
|
const port = process.env.APP_PORT;
|
|
|
|
// Start the server and listen on the specified port
|
|
app
|
|
.listen(port, () => {
|
|
console.info(`Server is listening on port ${port}`);
|
|
})
|
|
.on("error", (err) => {
|
|
console.error("Error:", err.message);
|
|
});
|