前言
部署
准备资源
配置域名解析
Type | Name | Priority | Value | TTL |
---|---|---|---|---|
MX | @ | 10 | stmp.webzhan.xyz | 600 |
A | stmp | 8.213.xxx.xxx | 600 | |
A | @ | 8.213.xxx.xxx | 600 |
VPS 初始化
参考文章: docker和docker-compose一键安装脚本
docker-compose.yml
Caddy配置
启动并使用
docker-compose up -d
https://webzhan.xyz/
FAQ
服务端打印日志
// 自定义日志打印
const fs = require('fs');
const output = fs.createWriteStream('./logs/stdout.log');
const errorOutput = fs.createWriteStream('./logs/stderr.log');
var logger = new console.Console(output, errorOutput);
//需要输出日志的位置
logger.log(JSON.stringify(data, null, 2));
启动抱错: Not Found
//app.use(function(req, res, next) {
// let err = new Error('Not Found');
// err.status = 404;
// next(err);
//});
//
//app.use(err => debug(err));
评论 (0)