mirror of
https://gitlab.com/little-lines/backend.git
synced 2024-11-21 23:36:50 +00:00
24 lines
No EOL
599 B
JavaScript
24 lines
No EOL
599 B
JavaScript
const express = require("express");
|
|
const app = express();
|
|
const cors = require('cors');
|
|
const dotenv = require("dotenv").config();
|
|
const connectDb = require('./config/dbConnection');
|
|
// const fav = require('./routes/favRoute');
|
|
|
|
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.use('/api/favorites', require('./routes/favRoute'));
|
|
|
|
app.listen(process.env.PORT, () => {
|
|
console.log(`server's running on port ${process.env.PORT}`);
|
|
})
|
|
|
|
connectDb(); |