gpt4 book ai didi

node.js - 在哪里可以找到express.js设置

转载 作者:太空宇宙 更新时间:2023-11-04 01:14:36 26 4
gpt4 key购买 nike

我几乎羞于问这个问题,但是我在哪里可以找到有关express.js 设置的信息?根据文档,我可以使用 app.set(name, setting) 将设置 name 分配给 setting,但是我在任何地方都找不到有哪些设置以及它们如何工作。

最佳答案

您可以在这里找到它:

http://expressjs.com/api.html#app-settings

settings

The following settings are provided to alter how Express will behave:

  • env Environment mode, defaults to process.env.NODE_ENV or "development"
  • trust proxy Enables reverse proxy support, disabled by default
  • jsonp callback name Changes the default callback name of ?callback=
  • json replacer JSON replacer callback, null by default
  • json spaces JSON response spaces for formatting, defaults to 2 in development, 0 in production
  • case sensitive routing Enable case sensitivity, disabled by default, treating "/Foo" and "/foo" as the same
  • strict routing Enable strict routing, by default "/foo" and "/foo/" are treated the same by the router
  • view cache Enables view template compilation caching, enabled in production by default
  • view engine The default engine extension to use when omitted
  • views The view directory path

关于node.js - 在哪里可以找到express.js设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11934312/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com