Express project Create and start services:

Source: Internet
Author: User
Tags folder express
By default you have installed Express:

Desktop new Folder Express for our test project:

1,CD to Project execution command:

C:\USERS\22945\DESKTOP\EXPRESS>EXPRESS-E service

  warning:option '--ejs ' has been renamed to '--view=ejs

   ' Create:service
   create:service/package.json
   create:service/app.js
   create:service/public
   Create: Service/routes
   create:service/routes/index.js
   create:service/routes/users.js
   create:service/views
   create:service/views/index.ejs
   Create:service/views/error.ejs
   create:service/public/ JavaScripts
   create:service/public/stylesheets
   create:service/public/stylesheets/style.css
   Create:service/bin
   create:service/bin/www

   Install dependencies:
     > CD service && NPM Install

   run the app:
     > SET debug=service:* & npm start

   create:service/public/images

The file will now be generated under our folder under the Folder Service folder.

2, perform NPM install and install node_moudle files.

C:\USERS\22945\DESKTOP\EXPRESS\SERVICE>NPM Install
NPM notice created a lockfile as Package-lock.json. You are should commit this file.
Added packages in 3.362s

3, start the service:

Execution: NPM start:

C:\USERS\22945\DESKTOP\EXPRESS\SERVICE>NPM start

> service@0.0.0 start C:\Users\22945\Desktop\express\ Service
> node./bin/www

get/admin/list 404 13.321 ms-1076
get/favicon.ico 404
1.485 to ms-1076 get /2.234 ms-207
get/stylesheets/style.css 3.523 ms-111

Browser access: The localhost:8080 interface is as follows:

After the project has been created, we can develop the project below.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.