small node js tests
This commit is contained in:
9
tests/tests_hugo/index.html
Normal file
9
tests/tests_hugo/index.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<!Doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>my title</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>my page</h1>
|
||||
</body>
|
||||
</html>
|
||||
25
tests/tests_hugo/server.js
Normal file
25
tests/tests_hugo/server.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// console.log('salut')
|
||||
let http = require('http')
|
||||
let fs = require('fs')
|
||||
|
||||
let server = http.createServer()
|
||||
|
||||
server.on('request', (request, response) => {
|
||||
|
||||
// fs.readFile('index.html', (err, data) => {
|
||||
// if (err) {
|
||||
// response.writeHead(404)
|
||||
// response.end('file not found')
|
||||
// }
|
||||
// else {
|
||||
// response.writeHead(200, {
|
||||
// 'content-type': 'text/html; charset=utf-8'
|
||||
// })
|
||||
// response.end('salut comment ca va')
|
||||
// }
|
||||
// })
|
||||
|
||||
})
|
||||
|
||||
server.listen('8080')
|
||||
|
||||
Reference in New Issue
Block a user