Now v2 is lovely!
I'm considering a method to migrate from v1 to v2. I'm hosting a static site with serve on v1. And, using the default routing of serve. So, the start property of package.json for that project is as follows.
"start": "serve dist"
I do not know what to define for the routes property in v2 for routing like serve.
Should I create a server like index.js to run serve-handler's API and define the builds property as follows?
"builds": [ { "src": "index.js", "use": "@now/node-server" } ] }
I resolved this by routing which forwards all requests to dist.
{
"version": 2,
"builds": [{ "src": "dist/**", "use": "@now/static" }],
"routes": [{ "src": "/(.*)", "dest": "/dist/$1" }]
}
Up to this time /foo responded to /foo.html, but I have not tried that the same routing is possible. I put /foo/index.html there.
Most helpful comment
I resolved this by routing which forwards all requests to
dist.Up to this time
/fooresponded to/foo.html, but I have not tried that the same routing is possible. I put/foo/index.htmlthere.