当前位置:网站首页>node. JS express connect mysql write webapi Foundation
node. JS express connect mysql write webapi Foundation
2022-06-25 20:08:00 【Fu Zongheng】
Catalog
newly build
Use webstorm newly build 
Cross domain
Be careful app and router, Corresponding module.exports = app; module.exports = router;
stay app.js or index.js Medium plus 
Kulian

Port default 3306, In case of modification creatConnection Add port that will do
Interface
var url = require(‘url’);
They correspond to each other : Request method , front end query Parameters , Database execution SQL sentence , Return results
front end data data
var data = req.body
In this case .format For custom methods ,javascript Provides more convenient string templates, such as :
var id = 1
var sql = `SELECT * FROM table1 WHERE id='${
id}'`
边栏推荐
- Pcl+vs2019+opencv environment configuration
- 2、 Hikaricp source code analysis of connection acquisition process II
- 在打新债开户证券安全吗?低佣金靠谱吗
- VMware failed to prompt to lock this profile exclusively
- 在打新債開戶證券安全嗎?低傭金靠譜嗎
- 1、 Hikaricp source code analysis of connection acquisition process I
- Wechat applet cloud function does not have dependency option installed
- From now on, I will blog my code
- Redis thread level reentrant distributed lock (different unique IDs can be locked cyclically)
- Jsonp processing non homologous
猜你喜欢

Swin UNET reading notes

Bindgetuserinfo will not pop up

Verification code native JS canvas

Jsonp non homologous interaction (click trigger)

Wechat applet connects to the server to display mqtt data information

Using flex to implement the Holy Grail layout is as simple as that

Huawei HMS core launched a new member conversion & retention prediction model

Redis practice: smart use of data types to achieve 100 million level data statistics

Impact of Huawei application transfer and application claim on user identification

Hdoj topic 2005 day
随机推荐
<C>. String comparison
PAT B1061
III Implementation principle of vector
Browser performance optimization (19)
Applet multi image to Base64 upload
Vulnhub range - the planes:venus
JS asynchronism (III. usage of generator and async/await)
Uniapp waterfall flow, applet waterfall flow, very simple, suitable for the whole platform
From now on, I will blog my code
How to understand var = a = b = C = 9? How to pre parse?
PAT B1067
8. iterators and generators
<C>. tic-tac-toe
Appearance of object attributes
Profile path and name
K-fold cross validation
Alicloud centos8.0 installing mysql8
PAT B1096
Now meditation: crash service and performance service help improve application quality
<C>. array