部署步骤
1 基础环境准备
# 必须组件
- Node.js v18+ (推荐LTS版本)
- npm v9+ 或 yarn v1.22+
- Git
# 验证安装
node -v && npm -v2 获取前端代码
git clone https://github.com/ethereumfair/opendex.git
cd opendex3 安装依赖
npm install
# 或
yarn install4 启动服务器
npm run serve
# 访问 http://localhost:80805 生产环境构建
npm run build
# 生成静态文件到 /dist 目录6 部署到本地服务器
推荐使用Nginx配置示例:
server {
listen 8080;
server_name localhost;
location / {
root /path/to/dist;
try_files $uri $uri/ /index.html;
}
}Last updated