Express使用Https服务器

var fs = require('fs');
var http = require('http');
var https = require('https');
var privateKey = fs.readFileSync('sslcert/server.key', 'utf8');
var certificate = fs.readFileSync('sslcert/server.crt', 'utf8'); var credentials = {key: privateKey, cert: certificate};
var express = require('express');
var app = express(); // your express configuration here var httpServer = http.createServer(app);
var httpsServer = https.createServer(credentials, app); httpServer.listen(8080);
httpsServer.listen(8443);
上一篇:JAVA线程池的创建与使用


下一篇:Linux下find命令用法小结