nextjs-starter icon indicating copy to clipboard operation
nextjs-starter copied to clipboard

Upgrade the deployment settings to now v2

Open aruzikulov opened this issue 5 years ago • 5 comments

Now v2 has more benefits, just changing the now.json file's version into v2 isn't working. It would be great if someone upgrade zeit now settings to now v2

aruzikulov avatar Jan 26 '19 02:01 aruzikulov

@aruzikulov I'm also interested in this upgrade - I know that the sample now.json for both NextJS and Express are a bit more complex than changing the number but not much more.... we would basically have to configure the routes.

@iaincollins mind if I take a stab at it and then open a PR for you to review?

NextJS sample

{
    "version": 2,
    "name": "nextjs",
    "builds": [
        { "src": "next.config.js", "use": "@now/next" }
    ]
}

Express sample

{
  "version": 2,
  "name": "my-express-project",
  "builds": [
    { "src": "www/**/*", "use": "@now/static" },
    { "src": "api/**/*.js", "use": "@now/node" }
  ],
  "routes": [{ "src": "/", "dest": "www/index.html" }]
}

headwinds avatar Jun 10 '19 15:06 headwinds

I did a little research and kicked the tires - I'm getting build errors on the routes so it does seem more complicated than I had thought

issues:

nextjs & express thread 1

nextjs & express thread 2

Custom Routes Solution

Zeit Doc

More great discussion...

how-to-deploy-next-js-app-with-custom-express

express & nextjs

...which has a nice example by @hvaoc http://unplggd.co which looks promising

demo

github source <-- I'll try his project

demo <-- I was able to deploy it - it just took awhile... first time it timed out but second time it deployed in about 2 minutes - not sure why it takes so long but its working

headwinds avatar Jun 10 '19 16:06 headwinds

Ugh thanks!

The changes that are now in Next.js 9 and the release of now.sh were why I let this stall for so long.

I hope to update with the new CSS, API route handling in Next.js, and upgrade it to now.sh 2, with additional config that allows it to also be deployed out of the box on Google Cloud Platform, AWS and AWS Edge.

iaincollins avatar Oct 21 '19 00:10 iaincollins

perfect, can't wait to see your update :)

aruzikulov avatar Oct 21 '19 03:10 aruzikulov

Ugh thanks!

The changes that are now in Next.js 9 and the release of now.sh were why I let this stall for so long.

I hope to update with the new CSS, API route handling in Next.js, and upgrade it to now.sh 2, with additional config that allows it to also be deployed out of the box on Google Cloud Platform, AWS and AWS Edge.

Any news?

RomanShabanov avatar Feb 03 '20 11:02 RomanShabanov