임에딘

add code to upload images

1 var http = require('http'); 1 var http = require('http');
2 var fs = require('fs'); 2 var fs = require('fs');
3 +var express=require('express');
4 +var app=express();
5 +
6 +app.get('/', function(req,res){
7 + fs.readFile('index.html',function(err,data){
8 + res.writeHead(200,{'Content-Type':'text/html'});
9 + res.end(data);
10 + });
11 +});
12 +
13 +app.get('/imgs',function(req,res){
14 + fs.readFile('logoIMG.jpg',function(err,data){
15 + res.writeHead(200,{'Content-Type':'text/html'});
16 + res.end(data);
17 + });
18 +});
19 +
20 +app.listen(8080,function(){
21 + console.log('Server Start.');
22 +})
23 +/*
3 http.createServer(function (req, res) { 24 http.createServer(function (req, res) {
4 fs.readFile('index.html', function(err, data) { 25 fs.readFile('index.html', function(err, data) {
5 res.writeHead(200, {'Content-Type': 'text/html'}); 26 res.writeHead(200, {'Content-Type': 'text/html'});
...@@ -7,3 +28,4 @@ http.createServer(function (req, res) { ...@@ -7,3 +28,4 @@ http.createServer(function (req, res) {
7 res.end(); 28 res.end();
8 }); 29 });
9 }).listen(8080); 30 }).listen(8080);
31 +*/
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
10 <body> 10 <body>
11 11
12 <p stype="fond-family:verdana;">StarCraft 2 Build Recommendation Project</p> 12 <p stype="fond-family:verdana;">StarCraft 2 Build Recommendation Project</p>
13 -<img src="logoIMG.jpg" alt="StarCraft2 LOGO image"> 13 +<img src="/imgs" alt="StarCraft2 LOGO image">
14 <br> 14 <br>
15 <br> 15 <br>
16 <div class="col-md-3"> 16 <div class="col-md-3">
......