mirror of
https://gitlab.com/little-lines/backend.git
synced 2024-11-10 03:44:25 +00:00
21 lines
No EOL
496 B
JavaScript
21 lines
No EOL
496 B
JavaScript
const express = require("express");
|
|
const app = express();
|
|
const cors = require('cors');
|
|
const dotenv = require("dotenv").config();
|
|
const connectDb = require('./config/dbConnection');
|
|
|
|
app.use(express.json());
|
|
app.use(cors());
|
|
app.use('/api/users', require('./routes/userRoute'));
|
|
|
|
app.get('/', function(req, res) {
|
|
res.json({
|
|
version: "DATE-VERSION"
|
|
});
|
|
});
|
|
|
|
app.listen(process.env.PORT, () => {
|
|
console.log(`server's running on port ${process.env.PORT}`);
|
|
})
|
|
|
|
connectDb(); |