Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Upgrade to Nuxt/Vue renderer? #22

Open
jamesladd opened this issue Feb 13, 2021 · 7 comments
Open

Upgrade to Nuxt/Vue renderer? #22

jamesladd opened this issue Feb 13, 2021 · 7 comments

Comments

@jamesladd
Copy link

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 ;)

  • James.
@ffxsam
Copy link

ffxsam commented Mar 16, 2021

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
Copy link
Author

jamesladd commented Mar 16, 2021 via email

@ffxsam
Copy link

ffxsam commented Mar 16, 2021

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
Copy link
Author

jamesladd commented Mar 16, 2021 via email

@ffxsam
Copy link

ffxsam commented Mar 17, 2021

@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
Copy link

ffxsam commented Mar 17, 2021

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
Copy link
Author

jamesladd commented Mar 17, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants