-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
41 lines (30 loc) · 1.16 KB
/
app.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
// Full Documentation - https://docs.turbo360.co
const vertex = require('vertex360')({ site_id: process.env.TURBO_APP_ID })
const app = vertex.express() // initialize app
/*
Apps can also be initialized with config options as shown in the commented out example below. Options
include setting views directory, static assets directory, and database settings. To see default config
settings, view here: https://docs.turbo360.co
const config = {
views: 'views', // Set views directory
static: 'public', // Set static assets directory
db: { // Database configuration. Remember to set env variables in .env file: MONGODB_URI, PROD_MONGODB_URI
url: (process.env.TURBO_ENV == 'dev') ? process.env.MONGODB_URI : process.env.PROD_MONGODB_URI,
type: 'mongo',
onError: (err) => {
console.log('DB Connection Failed!')
},
onSuccess: () => {
console.log('DB Successfully Connected!')
}
}
}
const app = vertex.app(config) // initialize app with config options
*/
// import routes
const index = require('./routes/index')
const api = require('./routes/api')
// set routes
app.use('/', index)
app.use('/api', api) // sample API Routes
module.exports = app