Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var http = require('http');
- var express = require('express');
- var app = express();
- const port = 8000;
- app.use(express.static('public'));
- app.get('/', function(request, response) {
- console.log("asd");
- response.sendFile(__dirname + '/index.html');
- });
- app.get('/controller', function(request, response) {
- console.log(__dirname + '/controller.html');
- response.sendFile(__dirname + '/public/controller.html');
- });
- /*server = http.createServer(function(request, response){
- response.writeHead(200, {'Content-type':'text/html'});
- response.write('Hello Node JS Server Response');
- response.end();
- });*/
- app.listen(port);
- console.log(`Server running at http://localhost:${port}/`);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement