samedi 9 mai 2015

Nodejs - incorporate HTML files

I'm super new to NodeJS and I'm using it for a small college project. The project itself is a Unity based game and as part of this project I need to build a small website for it.

I've created a few HTML files (homepage,about,download page,registration form).

I know I can use:

var http = require('http');

http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/plain'});
  response.end('Hello World\n');
}).listen(3000);

But this just displays one line of text.

I would like to link all of these pages or set the homepage using Nodejs. Can you please let me know how I can do that?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire