FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TypeScriptSamples/node/src/HttpServer.ts at master · mj91/TypeScriptSamples · GitHub
mj91
TypeScriptSamples
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
TypeScriptSamples
/
node
/
src
/
HttpServer.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (11 loc) · 406 Bytes
Breadcrumbs
TypeScriptSamples
/
node
/
src
/
HttpServer.ts
Copy path
File metadata and controls
14 lines (11 loc) · 406 Bytes
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
/**
* HTTPS server example.
*/
import
{
createServer
,
IncomingMessage
,
ServerResponse
}
from
'http'
;
const
host
=
'localhost'
;
const
port
=
1337
;
const
server
=
createServer
(
(
_
:
IncomingMessage
,
res
:
ServerResponse
)
=>
{
res
.
writeHead
(
200
,
{
'Content-Type'
:
'text/plain'
}
)
;
res
.
end
(
'Hello World\n'
)
;
}
)
;
server
.
listen
(
port
,
host
,
(
)
=>
{
console
.
log
(
`Server running at
${
host
}
:
${
port
}
`
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL