Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김동훈
/
OpenSource_Project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Donghoon Kim
2018-12-14 09:08:43 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5b290eb12b5e8cfd01b8e2cd85554495dc9aeb72
5b290eb1
1 parent
ab12ccab
added routing
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
app.js
app.js
View file @
5b290eb
var
express
=
require
(
'express'
);
var
router
=
require
(
'./routes/index'
);
var
app
=
express
();
var
fs
=
require
(
'fs'
)
app
.
use
(
'/'
,
router
);
app
.
use
(
'/'
,(
req
,
res
)
=>
{
res
.
writeHead
(
200
,
{
'Content-Type'
:
'text/html'
})
fs
.
readFile
(
__dirname
+
'/public/index.html'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
err
)
return
res
.
status
(
500
).
json
(
err
)
}
else
res
.
end
(
data
,
'utf-8'
)
})
})
var
server
=
app
.
listen
(
3000
);
...
...
Please
register
or
login
to post a comment