FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
unexcoder_server/controllers/frontController.js at main · unexCoder/unexcoder_server · GitHub
unexCoder
unexcoder_server
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
unexcoder_server
/
controllers
/
frontController.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (36 loc) · 1.08 KB
Breadcrumbs
unexcoder_server
/
controllers
/
frontController.js
Copy path
File metadata and controls
38 lines (36 loc) · 1.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
const
Album
=
require
(
'../models/album'
)
;
// render_home
const
render_home
=
(
req
,
res
)
=>
{
res
.
render
(
'index'
,
{
title
:
'\\unexCoder Server'
}
)
}
// render-data
const
render_data
=
(
req
,
res
)
=>
{
res
.
render
(
'data'
,
{
title
:
'\\unexCoder Server'
}
)
;
}
// render-music
const
render_music
=
(
req
,
res
)
=>
{
Album
.
find
(
)
.
sort
(
{
createdAt
:
-
1
}
)
.
then
(
(
result
)
=>
{
res
.
render
(
'music/index'
,
{
title
:
'\\unexCoder | Albums'
,
data
:
result
}
)
}
)
.
catch
(
(
err
)
=>
console
.
log
(
err
)
)
}
// render-album-details
const
render_album_details
=
(
req
,
res
)
=>
{
const
id
=
req
.
params
.
id
;
Album
.
findById
(
id
)
.
then
(
(
result
)
=>
{
res
.
render
(
'music/details'
,
{
title
:
'\\unexCoder | Albums'
,
data
:
result
}
)
}
)
.
catch
(
(
err
)
=>
console
.
log
(
err
)
)
}
// render-about
const
render_about
=
(
req
,
res
)
=>
{
res
.
render
(
'about'
,
{
title
:
'\\unexCoder Server | About'
}
)
;
}
// render-404
const
render_404
=
(
req
,
res
)
=>
{
res
.
status
(
404
)
.
render
(
'404'
,
{
title
:
'Not Found'
}
)
;
}
module
.
exports
=
{
render_home
,
render_data
,
render_music
,
render_album_details
,
render_about
,
render_404
}
Back
|
FazBrowse Home
|
New Git URL