I installed express 4 along with node.js,npm and express-generator on my ubuntu 12.04 and created an app using the following commands:
express test --hogan -c less
cd test && npm install
node app.js
Now what I should get is "Express server running on port 3000" but instead the command simply executes and doesn't leave any message or error. So I have no idea of which port express is running on or whether or not it is running at all. So does anyone know what's going wrong in it? Thanks in advance.
Express is currently, and for many years, the de-facto library in the Node. js ecosystem. When you are looking for any tutorial to learn Node, Express is presented and taught to people.
Express is a node js web application framework that provides broad features for building web and mobile applications. It is used to build a single page, multipage, and hybrid web application. It's a layer built on the top of the Node js that helps manage servers and routes.
Developers need to install ExpressJS along with NodeJS to use it. There is no need to install AngularJS on their computer system to use it. Used for developing server-side and networking applications. Used for building server-side applications on NodeJS.
The new express-generator does not add the app.listen
statement in the auto-generated app.js file. It could be a bug? What you can do is add a statement like
app.listen(3000, function () {
console.log("express has started on port 3000");
});
This will instruct express to listen on port 3000 and print out a helpful message on the console as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With