Can we say node.js is a web server?

后端 未结 9 686
孤街浪徒
孤街浪徒 2020-12-22 15:56

I found that I am confusing between web framework and web server.

Apache is a web server.

Tornado is a web server written in Python.

9条回答
  •  余生分开走
    2020-12-22 16:15

    I just used Node.js for the first time to create a Discord bot. My thought was "Wow, Node.js is a server? I thought it was a JS library!" Or perhaps I could have thought about it as a framework.

    Is it a web server? No but you can make one with it. Is it a server? As in the software that receives queries and serves the result? Yes.

    In my case, I have issued the command: node index.js

    And now Node.js is waiting for requests to respond to (via my bot). It's a server, but it isn't serving web pages.

提交回复
热议问题