1

Can I use node.js server as a web server?

Such as I will run aspx sites or wcf service in node.js server instead of IIS? Can I do it without IIS?

2 Answers 2

3

There are several alternatives to IIS for hosting ASP.NET applications such as:

  • IIS Express
  • Apache (Mono)
  • Cassini (not actively developped)
  • Kayak Project (not actively developped)
  • C# WebServer (not actively developped)
  • Abyss (not actively developped)

There are probably others, but generally most of them aren't actively developed.

Node.js is a little different. It is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. It fetures a event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. It can still act as a web server and serve content. Node applications, to my knowledge, are written in JavaScript.

With this said:

  • Node.js can run on IIS, that's different from .NET running on Node.js
  • ASP.NET websites cannot run on Node.js
  • ASP.NET projects can benefit from using Node.js for some of its operations
  • ASP.NET has its own technology similar to Node.js and Socket.io called SignalR

TLDR - No, you can't.

Sign up to request clarification or add additional context in comments.

3 Comments

Technically, if there is an ASP interpreter that outputs to stdout (instead of a socket) or if there's a CGI ASP interpreter then you can do this by simply executing that interpreter with the ASP page as input (maybe emulating CGI by setting the right environment variables) and read the generated string and return it back to the browser. But I don't know enough about ASP to know if one exist. Though you may be able to write one in Mono.
Here's one node server that can act as a CGI server: npmjs.org/package/node-simple-router. The only missing ingredient is an ASP interpreter that can work in CGI mode. Though I have to admit this is a very convoluted way of avoiding Apache or IIS.
It's interesting to know nevertheless, but it's probably not practical to go down this way. I think erginduran was confused about what Node.js is, rather than trying to find cheesy solutions.
2

These are different technologies, taken from Node.js website:

Node.js® is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

It is feasible to develop an aspnx interpreter in javascript, but makes absolutely no sense to implement one programming language in another programming language.


There must be a reason of this question asked, you could instead tell us why do you desire to have Nodejs to become an aspx server, there might be more elegant solution.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.