-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
48 lines (38 loc) · 1.32 KB
/
server.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const express = require('express');
const app = express();
const Events = require('./routes/events');
const Event_reg = require('./routes/event_reg');
const Users = require('./routes/auth/auth_user');
const ForgotPassword = require('./routes/auth/forgotPassword');
const Resetpass = require('./routes/auth/resetpass');
const Admin = require('./routes/auth/auth_admin');
const bodyParser = require('body-parser');
const connectDB = require('./config/db_connect.js');
const cors = require('cors');
var CubejsServerCore = require('@cubejs-backend/server-core');
// const CubejsServer = require("@cubejs-backend/server");
const path = require("path");
connectDB();
app.use(cors());
app.use(bodyParser.json());
const serverCore = CubejsServerCore.create();
serverCore.initApp(app);
app.use('/api/events',Events);
app.use('/api/user',Users);
app.use('/api/user/event_reg',Event_reg);
app.use('/api/admin',Admin);
app.use('/api/user', ForgotPassword);
app.use('/api/user/reset', Resetpass);
require("dotenv").config();
// app.use('/api/event_reg',Event_reg);
// app.get('/', (req,res,err) =>{
// // if(err)
// // console.log("unable to access",err);
// // else
// // res.send('HEllo');
// // })
app.listen(8000, (err) =>{
if(err)
console.log(err)
console.log(`🚀 Cube.js server is listening on 8000`)
})