将监听端口改为全部地址==-==
This commit is contained in:
2
app.js
2
app.js
@@ -100,7 +100,7 @@ fastify.addHook('onRequest', async (request, reply) => {
|
|||||||
const start = async () => {
|
const start = async () => {
|
||||||
try {
|
try {
|
||||||
// 监听 3000 端口
|
// 监听 3000 端口
|
||||||
await fastify.listen({ port: 3000 });
|
await fastify.listen({ port: 3000, host: '0.0.0.0'});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// 如果启动失败,打印错误日志并退出
|
// 如果启动失败,打印错误日志并退出
|
||||||
fastify.log.error(err);
|
fastify.log.error(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user