tonyfromundefined / nuxt-serverless

Nuxt.js Serverless SSR Starter on AWS (Lambda + API Gateway + S3) with Serverless Framework
254 stars 32 forks source link

Upgrade to Nuxt/Vue renderer? #22

Open jamesladd opened 3 years ago

jamesladd commented 3 years ago

Hi Tony,

I really like this project. Very well laid out and clean.

It worked right out of the box which is great. However, when I try to upgrade Nuxt or Vue renderer things break. Would it be possible to upgrade to latest Vue 2.x and associated Nuxt? I'd pay for this work if that helps motivate ;)

ffxsam commented 3 years ago

I noticed quite a few things are out of date, including the Serverless Framework dependency. I'm also not 100% sure if express is even needed at all.

If @tonyfromundefined no longer actively maintains this project, I'll probably make my own fork and bring everything up to date.

jamesladd commented 3 years ago

Please do - it is a good starter project and w be good to see it maintained.

Why do you think express isn’t even required?

Sent from my Commodore 64

On 17 Mar 2021, at 5:09 am, Sam Hulick @.***> wrote:

 I noticed quite a few things are out of date, including the Serverless Framework dependency. I'm also not 100% sure if express is even needed at all.

If @tonyfromundefined no longer actively maintains this project, I'll probably make my own fork and bring everything up to date.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ffxsam commented 3 years ago

Express's main job is to provide routing capabilities and set up a listener, right? API Gateway already does all that. By adding Express to the mix, it's just adding bloat.

jamesladd commented 3 years ago

I'd be very interested in an example without express.

On Wed, Mar 17, 2021 at 9:03 AM Sam Hulick @.***> wrote:

Express's main job is to provide routing capabilities and set up a listener, right? API Gateway already does all that. By adding Express to the mix, it's just adding bloat.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tonyfromundefined/nuxt-serverless/issues/22#issuecomment-800643397, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAYUBE3QBHWPH3BLCHMFN3TD7IUDANCNFSM4XRSD5XA .

ffxsam commented 3 years ago

@jamesladd I don't have time to get into details, but this is how you can load up Nuxt in Lambda without Express:

const { loadNuxt } = require('nuxt-start');

module.exports.render = async (event) => {
  const nuxt = await loadNuxt({ for: 'start' });
  const { html } = await nuxt.renderRoute(event.requestContext.http.path);

  return {
    statusCode: 200,
    body: html,
    headers: {
      'Content-Type': 'text/html',
    },
  };
};

Hope that's somewhat helpful as a starting point!

ffxsam commented 3 years ago

Oh, and this plugin for Serverless was incredibly helpful: https://github.com/wan2land/serverless-nuxt

But I don't use their createNuxtApp which uses express.

jamesladd commented 3 years ago

Thank you. Very helpful

On Thu, Mar 18, 2021 at 8:55 AM Sam Hulick @.***> wrote:

Oh, and this plugin for Serverless was incredibly helpful: https://github.com/wan2land/serverless-nuxt

But I don't use their createNuxtApp which uses express.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tonyfromundefined/nuxt-serverless/issues/22#issuecomment-801468185, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAYUBCMUUUA7QPXM5DNRWTTEEQNNANCNFSM4XRSD5XA .