loading...

How To Quickly Generate An Express App Skeleton And Then Edit It

yogesnsamy profile image yogesnsamy ・1 min read
  • First you must install the express-generator by typing:
    npm install -g express-generator

  • Next run the following command to create an express app with the ejs engine:
    express --view=ejs kikucare
    kikucare is the name of the app we're creating.

Alt Text

  • Go into the newly created app folder by typing:
    cd kikucare/

  • Install all dependencies by typing:
    npm install

  • Next start the app by typing the command:
    DEBUG=kikucare:* npm start

  • You can now view the app on the browser by going to the address http://localhost:3000/.

  • You'll see the following:
    Alt Text

Let's make a simple change to what's displayed on the browser!

  • We'll edit the file index.js from the folder routes.
    Alt Text

  • Modify line number 6 by replacing the title from 'Express' to 'Kikucare'
    Alt Text

  • Output:
    Alt Text

Posted on by:

yogesnsamy profile

yogesnsamy

@yogesnsamy

Once a coder always a coder!

Discussion

pic
Editor guide