Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSD Assignment2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pumudu seniya fernando
SSD Assignment2
Commits
b2b66634
Commit
b2b66634
authored
Oct 06, 2020
by
pumudu seniya fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
f6e0a886
Pipeline
#1715
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
index.js
index.js
+40
-0
No files found.
index.js
0 → 100644
View file @
b2b66634
const
express
=
require
(
'
express
'
)
const
homeRouter
=
require
(
'
./routes/home
'
)
const
authRouter
=
require
(
'
./routes/auth
'
)
const
passportConfig
=
require
(
'
./configs/passport
'
)
const
passport
=
require
(
'
passport
'
)
const
cookieSession
=
require
(
'
cookie-session
'
)
const
KEYS
=
require
(
'
./configs/keys
'
)
const
nunjucks
=
require
(
'
nunjucks
'
)
const
fileUpload
=
require
(
'
express-fileupload
'
)
// init app
let
app
=
express
()
const
port
=
4000
||
process
.
env
.
PORT
app
.
listen
(
port
,
()
=>
console
.
log
(
`server is running on
${
port
}
`
))
// init view
nunjucks
.
configure
(
'
views
'
,
{
autoescape
:
true
,
express
:
app
});
// init static
app
.
use
(
'
/static
'
,
express
.
static
(
'
public
'
))
// init session
app
.
use
(
cookieSession
({
keys
:
[
KEYS
.
session_key
]
}))
// init passport
app
.
use
(
passport
.
initialize
())
app
.
use
(
passport
.
session
())
// file upload
app
.
use
(
fileUpload
());
// init routes
app
.
use
(
''
,
homeRouter
)
app
.
use
(
'
/auth
'
,
authRouter
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment