-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
142vip.cn
committed
Nov 14, 2023
1 parent
06b4a5c
commit 4a53be9
Showing
31 changed files
with
1,037 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 设置基础镜像 | ||
FROM nginx:latest | ||
|
||
# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面 | ||
COPY dist/ /usr/share/nginx/html/ | ||
# 用本地的 default.conf 配置来替换nginx镜像里的默认配置 | ||
COPY default.conf /etc/nginx/conf.d/default.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 部署前端构建后的dist静态文件 | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
#charset koi8-r; | ||
access_log /var/log/nginx/host.access.log main; | ||
error_log /var/log/nginx/error.log error; | ||
|
||
location / { | ||
# root 根目录,默认nginx镜像的html文件夹,可以指定其他 | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
# 如果vue-router使用的是history模式,需要设置这个 | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
#error_page 404 /404.html; | ||
# redirect server error pages to the static page /50x.html | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const express = require('express') | ||
const app = express() | ||
const port = 3000 | ||
|
||
/** | ||
* 基础API服务,Get类型 | ||
*/ | ||
app.get('/', (req, res) => { | ||
res.send('Hello World!') | ||
}) | ||
|
||
app.listen(port, () => { | ||
console.log(`quick-start app listening on port ${port}`) | ||
}) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.