提交 4b30ac7c authored 作者: 王鹏飞's avatar 王鹏飞

refactor: 重构项目

上级 0995a54b
# 查到当前目录就可以了,不用再往下查找
root = true
# 对所有文件制定规范
[*]
charset = utf-8 # 字符编码
end_of_line = lf # 从左往右写
indent_size = 2 # tab键长度2个空格
indent_style = space
insert_final_newline = true # 保存自动加上一个空行
trim_trailing_whitespace = true # 每行最后空格去掉
{
"extends": "standard",
"plugins": [],
"parser": "babel-eslint",
"rules": {
"no-new": "off",
"no-debugger": "off"
},
"globals": {
"window": false,
"$": false,
"webConf": false
}
}
# Dependencies
node_modules/
# Environment variables
.env
.env.local
.env.*.local
# Logs
logs/
*.log
npm-debug.log*
pm2_*.log
# Upload temporary files
upload_tmp/
# OS files
.DS_Store .DS_Store
node_modules Thumbs.db
npm-debug.log
server-dist # IDE
node-dist .vscode/
dist .idea/
dist.zip *.swp
*.swo
# code protect - prevent submit code below
# Build
build/
dist/
ezijing-node-server-1.0.0 / 2019-10-30
======================================
* 追加接口,getInfo 是通过页面授权方式获取 unionID 和 openID
* 对应落地页测试页面 ezijing-pages/src/kelley/mobile-index.html
ezijing-node-server-1.0.0 / 2019-08-28
======================================
* 基于Node,开发的一套 提供 API的接口服务。
* 新增 api/test 接口。目的: 接口测试。
# 项目要求 # ezijing-node-server
* 书写时,每次完成书写,都需要进行代码规范检测,使用指令: `npm run lint`
* 提供的所有新接口 与 修改的接口 都必须 记录在 History.md 中。
* 所有提供的接口,必须在 postMan 中 进行 测试并通过,同时记录在 POSTMAN 中。
### 新增模块 Modern Node.js API server for WeChat services.
* request 引入文件
\ No newline at end of file ## Quick Start
```bash
# Install dependencies
npm install
# Development (with hot reload)
npm run dev
# Production
npm start
```
## Project Structure
```
src/
├── index.js # Entry point
├── app.js # Express app
├── config.js # Configuration
├── lib/ # Shared utilities
├── middleware/ # Global middleware
└── modules/ # Feature modules
├── wechat/ # WeChat SDK
└── wx-chart/ # WeChat chart data
```
## API Endpoints
| Method | Path | Description |
|--------|------|-------------|
| GET | `/health` | Health check |
| POST | `/share/getsignature` | Get WeChat JS-SDK signature |
| POST | `/share/token` | Get share token |
| POST | `/getInfo` | Get WeChat user info |
| GET | `/get/wx-chart/:key` | Get chart value |
| GET | `/set/wx-chart/:key` | Set chart value |
## Environment Variables
```env
NODE_ENV=development
SERVER_PORT=4101
DATA_DIR=../node-server-data
# WeChat config (numbered format)
WX_APPID_1=your_appid
WX_SECRET_1=your_secret
```
## Scripts
- `npm run dev` - Development with hot reload
- `npm start` - Production
- `npm run lint` - ESLint check
- `npm run lint:fix` - ESLint fix
- `npm run deploy:test` - Deploy to test
- `npm run deploy:prod` - Deploy to production
import globals from 'globals'
export default [
{
ignores: ['node_modules/', 'build/', 'dist/'],
},
{
files: ['src/**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
},
},
rules: {
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-console': 'off',
'comma-dangle': ['error', 'always-multiline'],
semi: ['error', 'never'],
quotes: ['error', 'single'],
},
},
]
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"baseUrl": ".",
"checkJs": false,
"resolveJsonModule": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论