Description
server.js is a Node.js framework for building web servers and APIs with little setup. It is installed from npm as the package called server. The project aims to include what most apps need by default, so developers can start defining routes quickly and write handlers with async and await. A route is a function that receives the request context and returns a value, and the server starts with a single call that takes options such as the port. Realtime channels are available through socket.io in a couple of lines. The project has tutorials and reference documentation, and it is fully compatible with Express middleware, so existing Express middleware can be used with it. The site lists use cases for small to medium projects, API design and real-time features. server.js requires Node.js 7.6.0 or newer, and the site recommends Node.js 8.x LTS. Its source code is on GitHub. The site presents it as a simple option for developers who want to focus on their own project rather than on server setup.…
Highlights
- Install from npm with little setup
- Routes with async and await
- Realtime channels with socket.io
- Compatible with Express middleware
- Requires Node.js 7.6.0 or newer
Ratings & Reviews
No ratings yet
Be the first to rate server.js.
People also visit
Simple Web Server
Create a local web server in just a few clicks with an easy to use interface
server.js FAQ
What is server.js?
server.js is a Node.js package for building web servers and APIs. It is installed with npm as server and includes routing and other features by default.
Which Node.js version do I need?
Node.js 7.6.0 or newer. The site recommends Node.js 8.x LTS.
Does it work with Express middleware?
Yes. The site says server.js is fully compatible with Express middleware.
How do I get started?
Run npm install server, then create an index.js file that requires server, defines a route with get, and starts the server. The site has a getting started tutorial for beginners.
Does it support realtime features?
Yes. Realtime channels are available through socket.io, and the site shows them set up in a couple of lines.
What are the best server.js alternatives?
Popular alternatives to server.js include Koa.js, Lodash.com and Simple Web Server. See all server.js alternatives





