-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
31 lines (29 loc) · 922 Bytes
/
index.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
var http = require('http');
var fs = require('fs');
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
console.log('Hi i am Bhuvan 1');
/*
http.createServer(function (req, res) {
console.log('hi i am bhuvan 2');
fs.readFile('index.html', function(err, data) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(data);
res.end();
console.log('I am bhuvan 3');
});
}).listen(8080) */
app.post('/logininsert', function(req, res) {
res.send('You sent the name "' + req.body.first_name + '".');
console.log("Hi i am Bhuvan");
});
app.listen(8080, function(req,res) {
fs.readFile('index.html', function(err, data) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(data);
res.end();
console.log('I am bhuvan 3');
});
console.log('Server running at http://127.0.0.1:8080/');
});