-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
29 lines (26 loc) · 927 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const express = require('express');
const morgan = require('morgan');
//const mysql = require('mysql');
const TransactionRoutes = require('./routes/TransactionRoutes');
const AuthRoutes = require('./routes/Auth');
const connectDB = require('./Utilities/Database');
const dotenv = require('dotenv');
const StudentRoutes = require('./routes/StudentDetails');
const cors = require('cors');
const { connect } = require('./routes/TransactionRoutes');
dotenv.config({ path: 'config.env' });
const app = express();
app.use(morgan('dev'));
app.use(cors());
app.use(express.json());
connectDB();
app.get('/', (req, res) => {
res.send('Home - Welcome to Feekart Backend');
});
//app.use('/transac', TransactionRoutes);
app.use('/', AuthRoutes);
app.use('/userprofile', StudentRoutes);
app.use('/transaction', TransactionRoutes);
app.listen(process.env.PORT || 3001, () => {
console.log('✅ Server is started at port: 3001');
});