Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
Oauth2_ssd
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
Dumindu Sanjana Hettiarachchi
Oauth2_ssd
Commits
8885870a
Commit
8885870a
authored
Oct 06, 2020
by
Dumindu Sanjana Hettiarachchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
01911eb9
Pipeline
#1708
canceled with stages
Changes
1
Pipelines
1
Show 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 @
8885870a
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
=
3000
||
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