当前位置:网站首页>Nodejs tutorial expressjs article quick start
Nodejs tutorial expressjs article quick start
2022-07-06 21:09:00 【Knowledge fatness】
What is? Expressjs
Express It is used on the server side Web Application's Node.js frame .Express be based on Node.js Function building , It can provide simple and fast Web And mobile server solutions . It is an open source framework , from Node.js Community maintenance . stay Express Many other libraries have been built on , Many large technology companies are using Express.
Project environment construction
Suppose you have installed Node.js, Create a directory to save your application , And set it as your working directory .
mkdir myapp
cd myapp
Use this npm init Command to create a package.json file . About how package.json Working
npm init
Now install in the directory Express And save it in the dependency list . for example :
npm install express
Project source code
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})
Project operation
Run the application with the following command :
node index.js
边栏推荐
- Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
- Is this the feeling of being spoiled by bytes?
- Le langage r visualise les relations entre plus de deux variables de classification (catégories), crée des plots Mosaiques en utilisant la fonction Mosaic dans le paquet VCD, et visualise les relation
- [asp.net core] set the format of Web API response data -- formatfilter feature
- 1_ Introduction to go language
- Xcode6 error: "no matching provisioning profiles found for application"
- C language operators
- OSPF multi zone configuration
- Infrared thermometer based on STM32 single chip microcomputer (with face detection)
- 2022菲尔兹奖揭晓!首位韩裔许埈珥上榜,四位80后得奖,乌克兰女数学家成史上唯二获奖女性
猜你喜欢
嵌入式开发的7大原罪
Interviewer: what is the internal implementation of ordered collection in redis?
SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍
3D人脸重建:从基础知识到识别/重建方法!
This year, Jianzhi Tencent
20220211 failure - maximum amount of data supported by mongodb
KDD 2022 | 通过知识增强的提示学习实现统一的对话式推荐
967- letter combination of telephone number
use. Net drives the OLED display of Jetson nano
Why do job hopping take more than promotion?
随机推荐
OSPF multi zone configuration
Swagger UI教程 API 文档神器
Comprehensive evaluation and recommendation of the most comprehensive knowledge base management tools in the whole network: flowus, baklib, jiandaoyun, ones wiki, pingcode, seed, mebox, Yifang cloud,
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
Manifest of SAP ui5 framework json
审稿人dis整个研究方向已经不仅仅是在审我的稿子了怎么办?
Summary of different configurations of PHP Xdebug 3 and xdebug2
The biggest pain point of traffic management - the resource utilization rate cannot go up
Can novices speculate in stocks for 200 yuan? Is the securities account given by qiniu safe?
Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
No Yum source to install SPuG monitoring
Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)
What is the problem with the SQL group by statement
None of the strongest kings in the monitoring industry!
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
What are RDB and AOF
Entity alignment two of knowledge map
【深度学习】PyTorch 1.12发布,正式支持苹果M1芯片GPU加速,修复众多Bug
Is it safe to open an account in flush? Which securities company is good at opening an account? Low handling charges
How to turn a multi digit number into a digital list