Skip to content

https server for hosting simple html pages.

License

Notifications You must be signed in to change notification settings

leecongwei/https-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

https-server

Basic https server that can host a simple web page.

Server:

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/');

About

https server for hosting simple html pages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%