-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
39 lines (30 loc) · 1.12 KB
/
Copy pathapp.js
File metadata and controls
39 lines (30 loc) · 1.12 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
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 database from './bootstrap/database';
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
database();
// Set of routes in an application
routes(app);
// Passport configuration
passport();
return app;
};