{"size": 861, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "glen03xs/g22-project", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server.js", "max_issues_repo_name": "glen03xs/g22-project", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server.js", "max_forks_repo_name": "glen03xs/g22-project", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.7, "max_line_length": 104, "alphanum_fraction": 0.6329849013}
const express = require('express');
const connectDB = require('./config/db');
const path = require('path')

const app = express();

// Connect DataBase - 
connectDB();

// Init Middleware
app.use(express.json({ exteded: false }));

// Define Routes
app.use('/api/users', require('./routes/users'));
app.use('/api/auth', require('./routes/auth'));
app.use('/api/candidates', require('./routes/candidates'));
app.use('/api/organizations', require('./routes/organizations'));

// Serve Static Assets
// if (process.env.NODE_ENV === 'production') {
// 	// Set Static folder
// 	app.use(express.static('client/build'));

// 	app.get('*', (req, res) => res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html')));
// }


const PORT = process.env.PORT || 6000;

app.listen(PORT, () => console.log(`Server started on ${PORT}`));