shopping-store-server's People
shopping-store-server's Issues
code review
- 不可修改或者不会改变的变量都应该使用const,比如下面代码中除了变量i会自增变化外,其他都应使用const
-
其实像这种格式校验(完全不需要后端操作数据库)一般都会放在前端,在用户输入框blur的时候就立马提示出来,按钮置灰,只有格式都正确了才能点击按钮去登录/注册,这样更快。等请求过来才校验格式有没有问题就太慢了
-
接口路径一般是遵从RESTFUL API设计规范,可以看下 这个,之前写的是有问题的,比如
orderRouter.post('/user/order/addOrder', auth.checkIsLogin, orderController.addProductsToOrder) shoppingRouter.post('/user/shoppingCart/getShoppingCart', auth.checkIsLogin, shoppingcartController.getShoppingCartProducts) shoppingRouter.post('/user/shoppingCart/deleteShoppingCart', auth.checkIsLogin, shoppingcartController.deleteShopingProducts)
正确的应该是这样:
orderRouter.post('/user/order/add', auth.checkIsLogin, orderController.addProductsToOrder) shoppingRouter.post('/user/shopping_cart/list', auth.checkIsLogin, shoppingcartController.getShoppingCartProducts) shoppingRouter.post('/user/shopping_cart/delete', auth.checkIsLogin, shoppingcartController.deleteShopingProducts)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.