-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
42 lines (33 loc) · 1.23 KB
/
Copy pathapp.js
File metadata and controls
42 lines (33 loc) · 1.23 KB
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
import express, { static as expressStatic } from 'express';
import './bootstrap/env';
import './bootstrap/helpers';
import routes from './app/Http/routes';
import processHandler from './bootstrap/process-handler';
import compress from './bootstrap/compress';
import coreMiddleware from './bootstrap/core-middleware';
import mongoose from './bootstrap/mongoose';
import databaseSeeder from './bootstrap/database-seeder';
import passport from './bootstrap/passport';
export default () => {
let app = express();
// processHandler();
// Gzip Compress for compressing all accessed files
compress(app);
// Build JS & CSS
app.use('/dist', expressStatic(`${__dirname}/public/dist`));
// Build Fonts
app.use('/fonts', expressStatic(`${__dirname}/public/fonts`));
// HTML Files
app.use('/views', expressStatic(`${__dirname}/resources/views`));
// This library uses for security purposes like session, crsf, passport, and helmet.
coreMiddleware(app);
// Database configuration
mongoose();
// Database Seeder
databaseSeeder();
// Set of routes in an application
routes(app);
// Passport configuration
passport();
return app;
}