Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to install Express.js in Ubuntu

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 276
    Comment on it

    Express.js is a framework that is use in the Node.js. It is having the Jade file which is similar to HTML file.

    To install Express first we have to include the express version in Package.json file.

    Inside Package.js

    {
      "name": "pong",
      "version": "0.5.1",
      "dependencies": {
        "express":"*"
      }
    }
    

    On the Command Prompt use this command.

    $ npm install express 
    

    Inside the Server.js use this code.

    var express = require('express')
    var app = express()
    
    app.get('/', function (req, res) {
      res.send('Hello World')
    })
    
    app.listen(3000)
    

    When you run on browser with this URL : localhost:3000 You will see the "Hello World" printed on the browser which means everything is perfect.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: