ariketari dagokion index.js fitxategia

This commit is contained in:
aitzol76 2021-04-08 11:41:31 +02:00
parent 350828e346
commit 5124690b03
1 changed files with 6 additions and 9 deletions

View File

@ -1,12 +1,9 @@
const express = require('express'); const http = require('http');
const app = express();
app.set('port', 8080); const server = http.createServer(function(req, res){
res.writeHead(200);
app.get('/', (req, res) => { res.end('Hello World!!');
res.status(200).send('Hello World!!');
}); });
app.listen(app.get('port'), () => { server.listen(8080);
console.log('Zerbitzaria martxan ' + app.get('port') + ' atakan'); console.log('http zerbitzaria lanean 8080 atakan...');
});