Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

PUBLIC / surfer-okd

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 74c0064c authored 8 years ago by Johannes Zellner's avatar Johannes Zellner
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

Fix the routing by using middleware selectively

1 parent 42e38e8c
Show whitespace changes
Inline Side-by-side
Showing with 9 additions and 9 deletions
  • server.js
server.js
View file @74c0064
......@@ -35,16 +35,16 @@ var rootFolder = path.resolve(__dirname, process.argv[2] || 'files');
app.use(morgan('dev'));
app.use(compression());
app.use('/_admin', express.static(__dirname + '/frontend'));
app.use(express.static(rootFolder));
app.use(serveIndex(rootFolder, { icons: true }));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false, limit: '100mb' }));
app.use(cookieParser());
app.use(session({ secret: 'surfin surfin', resave: false, saveUninitialized: false }));
app.use(passport.initialize());
app.use(passport.session());
app.use('/api', bodyParser.json());
app.use('/api', bodyParser.urlencoded({ extended: false, limit: '100mb' }));
app.use('/api', cookieParser());
app.use('/api', session({ secret: 'surfin surfin', resave: false, saveUninitialized: false }));
app.use('/api', passport.initialize());
app.use('/api', passport.session());
app.use(router);
app.use('/_admin', express.static(__dirname + '/frontend'));
app.use('/', express.static(rootFolder));
app.use('/', serveIndex(rootFolder, { icons: true }));
app.use(lastMile());
var server = app.listen(3000, function () {
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
  • Please register or sign in to post a comment