File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 "bugs" : {
1717 "url" : " https://github.com/CodewarsClone/Codewars/issues"
1818 },
19- "homepage" : " https://github.com/CodewarsClone/Codewars#readme"
19+ "homepage" : " https://github.com/CodewarsClone/Codewars#readme" ,
20+ "dependencies" : {
21+ "body-parser" : " ^1.15.2" ,
22+ "cors" : " ^2.8.1" ,
23+ "express" : " ^4.14.0" ,
24+ "express-session" : " ^1.14.2" ,
25+ "massive" : " ^2.5.0"
26+ }
2027}
Original file line number Diff line number Diff line change 1+ var express = require ( 'express' ) ;
2+ var bodyParser = require ( 'body-parser' ) ;
3+ var session = require ( 'express-session' ) ;
4+ var cors = require ( 'cors' ) ;
5+ var config = require ( './config.js' ) ;
6+ var massive = require ( 'massive' ) ;
7+ var connectionString = config . connectionString ;
8+
9+ var app = module . exports = express ( ) ;
10+
11+ var massiveInstance = massive . connectSync ( { connectionString : connectionString } ) ;
12+
13+ app . use ( express . static ( __dirname + '/public' ) ) ;
14+ app . use ( bodyParser . json ( ) ) ;
15+ app . use ( cors ( ) ) ;
16+
17+ app . set ( 'db' , massiveInstance ) ;
18+
19+ var db = app . get ( 'db' ) ;
20+
21+ app . use ( session ( {
22+ secret : config . sessionSecret ,
23+ saveUninitialized : false ,
24+ resave : false
25+ } ) ) ;
26+
27+ app . listen ( config . port , function ( ) {
28+ console . log ( 'listening to port' , config . port ) ;
29+ } ) ;
You can’t perform that action at this time.
0 commit comments