-
Notifications
You must be signed in to change notification settings - Fork 2
/
host.js
35 lines (28 loc) · 962 Bytes
/
host.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var http = require('http'),
express = require('express'),
fs = require('fs');
var dir = 'C:/Users/hunter/Desktop/HashtagMarketing/HMDevSite'
var server = express();
server.use(express.static(__dirname + '/public'));
server.get('/', function(req, res){
fs.readFile('index.html',function (err, data){
res.writeHead(200, {'Content-Type': 'text/html','Content-Length':data.length});
res.write(data);
res.end();
});
});
server.listen(8080);
/*
http.createServer(function(req, res){
fs.readFile('index.html',function (err, data){
res.writeHead(200, {'Content-Type': 'text/html','Content-Length':data.length});
res.write(data);
res.end();
});
/*fs.readFile(dir + '/css/styles.css', function (err, data) {
if (err) console.log(err);
res.writeHead(200, {'Content-Type': 'text/css','Content-Length':data.length});
res.write(data);
res.end();
});
}).listen(8080);*/