javascript - Nex.js 静态文件使用扩展名服务,无需下载
问题描述
我需要提供stellar.toml
文件,domain/.well-known/stellar.toml
并且内容类型需要是text/plain
. 我尝试像这样添加下一个配置,它只有在没有扩展名的情况下保存恒星文件时才有效。
我需要在domain/.well-known/stellar.toml
不提供内容domain/.well-known/stellar
module.exports = {
async headers() {
return [
{
source: "/.well-known/stellar",
headers: [
{
key: "Content-Type",
value: "text/plain",
},
],
},
];
},
};
解决方案
您可能应该在 NextJs 的 webpack 配置中添加 toml 扩展。https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config
推荐阅读
- python - 如何在 Python 中运行 MATLAB 代码
- aem - AEM 升级 6.1 到 6.4 Jar 问题
- json - 如何使用 golang 读取 JSON 文件中的环境变量?
- git - 生产服务器是否应该在开发人员的私人 github 帐户上拥有 SSH 密钥?
- javascript - Selenium if driver.is_enabled(): 不起作用
- python - 在两列上使用pandas groupby如何派生新列
- jsf - JSF Primefaces 6.2 更新 - p:selectOneMenu 显示问题
- java - 阿帕奇卢森。如何将通配符应用于 PhraseQuery 中的单词
- powerbi - DAX:访问父母的价值观?(使用连接表)
- fabricjs - FabricJS - 移动路径时,“路径”对象不会更新