var http = require('http');http.createServer(function (request, response) {
// 发送 HTTP 头部 // HTTP 状态值: 200 : OK // 内容类型: text/plain response.writeHead(200, {'Content-Type': 'text/plain'}); // 发送响应数据 "Hello World" response.end('Hello World\n');
}).listen(8080);
// 终端打印如下信息 console.log('Server running at https://127.0.0.1:8080/');
forked from CP102/https-server
-
Notifications
You must be signed in to change notification settings - Fork 0
https server for hosting simple html pages.
License
leecongwei/https-server
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
https server for hosting simple html pages.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- JavaScript 100.0%