Last active
January 5, 2020 09:12
-
-
Save choco0908/da21a855d1d2b9b56e2d4ca90923119d to your computer and use it in GitHub Desktop.
geoar.js 테스트 코드
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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