feat: 初始化项目并添加 JWT 认证
- 创建 .gitignore 文件,排除环境变量和节点模块 - 新增 app.js 文件,实现基本的 Koa 应用和 JWT 认证逻辑 - 添加 package.json 文件,定义项目依赖和启动脚本 安装依赖: - dotenv:用于加载环境变量 - jsonwebtoken:用于生成和验证 JWT 令牌 - koa:Koa 应用框架 - koa-jwt:Koa 的 JWT 中间件 - koa-router:Koa 的路由中间件
This commit is contained in:
18
package.json
Normal file
18
package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "vless-api",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
"start": "node app.js"
|
||||
},
|
||||
"author": "kubbo",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"dotenv": "^16.4.7",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"koa": "^2.15.4",
|
||||
"koa-jwt": "^4.0.4",
|
||||
"koa-router": "^13.0.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user