A multiple pages app built for OnlineJudge. Demo
- Webpack3 multiple pages with bundle size optimization
- Easy use simditor & Nice codemirror editor
- Amazing charting and visualization(echarts)
- User-friendly operation
- Quite beautiful:)
先安装 nodejs v8.12.0
git clone https://github.com/QingdaoU/OnlineJudgeFE.git
cd .\OnlineJudgeFE
npm install
# we use webpack DllReference to decrease the build time,
npm config set registry https://registry.npm.taobao.org --global # 设置淘宝镜像(全局)
npm install webpack -g
# this command only needs execute once unless you upgrade the package in build/webpack.dll.conf.js
NODE_ENV=development npm run build:dll
# the dev-server will set proxy table to your backend
export TARGET=http://Your-backend
# serve with hot reload at localhost:8080
git clone https://github.com/QingdaoU/OnlineJudgeFE.git
cd .\OnlineJudgeFE
npm install
# we use webpack DllReference to decrease the build time,
npm config set registry https://registry.npm.taobao.org --global # # 设置淘宝镜像(全局)
npm install webpack -g
# this command only needs execute once unless you upgrade the package in build/webpack.dll.conf.js
npm run build:dll
-
打开文件 \OnlineJudgeFE\config\index.js,起始位置加入一行以指定后台数据来源
process.env.TARGET = 'http://Your-backend'
运行
# serve with hot reload at localhost:8080
npm run dev
修改完成后打包生成dist文件夹
npm run build
dist文件夹传输到服务器
在服务器OnlineJudgeDeploy下,打开OJ配置文件docker-compose.yml
oj-backend:
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/oj_backend
container_name: oj-backend
restart: always
depends_on:
– oj-redis
– oj-postgres
– judge-server
volumes:
– $PWD/data/backend:/data
– /home/zzh/dist:/app/dist # 新增此行,路径请根据实际情况修改
environment:
– POSTGRES_DB=onlinejudge
– POSTGRES_USER=onlinejudge
– POSTGRES_PASSWORD=onlinejudge
– JUDGE_SERVER_TOKEN=CHANGE_THIS
# – FORCE_HTTPS=1
# – STATIC_CDN_HOST=cdn.oj.com
ports:
– "0.0.0.0:80:8000"
– "0.0.0.0:443:1443"
sudo -E docker-compose up -d # 更新前端
Modern browsers and Internet Explorer 10+.