learning express step(一)
first : create new project
then install express package :
npm install express --save
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\admin\WebstormProjects\IPSO-demo\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\admin\WebstormProjects\IPSO-demo\package.json'
npm WARN IPSO-demo No description
const express = require('express'); const app = express(); app.get('/',function (req,res) { res.send("hello world"); }); app.listen(3000, function () { console.log("example app listening"); });
running:
C:\Users\admin\WebstormProjects\IPSO-demo>node express-demo.js
example app listening
result: