I have some questions and problems trying to create a server with nodeJS .
The issue is that I have an application developed with very simple AngularJS and I want to make another one in nodeJS which basically loads AngularJS .
I created a little server using this code:
var http = require('http'),
fs = require('fs');
fs.readFile('./angular-js-web-form/index.html', function (err, html) {
if (err) {
throw err;
}
http.createServer(function(request, response) {
response.writeHeader(200, {"Content-Type": "text/html"});
response.write(html);
response.end();
}).listen(8000);
});
What it does is create a local server by reading the file index.html
, which is the index
of the application in angularJS :
Apparentlyitworks,butitcannotimportallstyles,allexternaljs,functions,andsoon.
Iknowthereareserversforthis,likegrunt,howeverIwantedtoavoidthem.Iwantmyangledapplicationtorunonlywithasimpleserverlikethisoneabove.
Doesanyonehaveanyideahowtohelp?Suggestion?
Thankyouinadvance.
ISSUE:
IendedupfindingthislinkwhichismoreorlesswhatIneed: link
Just that it still uses a module that is Express , it's only possible using it? Can not create local applications only by importing index
and index
doing import from the rest?