You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constexpress=require('express')constnext=require('next')constpkg=require('./package.json')constapp=next({dev: false})consthandle=app.getRequestHandler()asyncfunctioncreateServer(){awaitapp.prepare()constserver=express()server.all('*',(req,res)=>{returnhandle(req,res)})// define binary type for response// if includes, will return base64 encoded, very useful for imagesserver.binaryTypes=pkg.binaryTypes||['*/*']returnserver}module.exports=createServer
当然,如果需要自定义路由服务,可以在项目根目录下创建 sls.js 文件,进行自定义。
The text was updated successfully, but these errors were encountered:
在上一个版本中,使用此组件,用户需要在项目根目录新增
sls.js
文件,现在组件帮忙处理了,所以不需要用户处理了。默认sls.js
代码如下:当然,如果需要自定义路由服务,可以在项目根目录下创建
sls.js
文件,进行自定义。The text was updated successfully, but these errors were encountered: