Skip to content

Instantly share code, notes, and snippets.

@choco0908
Last active January 5, 2020 09:12
Show Gist options
  • Select an option

  • Save choco0908/da21a855d1d2b9b56e2d4ca90923119d to your computer and use it in GitHub Desktop.

Select an option

Save choco0908/da21a855d1d2b9b56e2d4ca90923119d to your computer and use it in GitHub Desktop.
geoar.js 테스트 코드
const express = require('express')
const fs = require('fs')
const app = express()
const port = 3000
const hostname = '192.168.43.137'
const https = require('https')
app.listen(port,hostname,() => console.log(`Example app listening on https://${hostname}!`))
var options = {
key : fs.readFileSync('serverpem/private.pem'),
cert : fs.readFileSync('serverpem/public.pem')
}
var https_server = https.createServer( options,(req,res) => {
fs.readFile('artest.html',function(error,data){
if(error){
console.log(error);
}
else{
res.writeHead(200);
res.end(data);
}
})
}).listen(443);
app.get('/', function(req, res){
fs.readFile('artest.html',function(error,data){
if(error){
console.log(error);
}
else{
res.writeHead(200);
res.end(data);
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment