Giter Club home page Giter Club logo

Comments (7)

ffxsam avatar ffxsam commented on May 26, 2024 1

@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!

from nuxt-serverless.

ffxsam avatar ffxsam commented on May 26, 2024 1

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.

from nuxt-serverless.

ffxsam avatar ffxsam commented on May 26, 2024

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.

from nuxt-serverless.

jamesladd avatar jamesladd commented on May 26, 2024

from nuxt-serverless.

ffxsam avatar ffxsam commented on May 26, 2024

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.

from nuxt-serverless.

jamesladd avatar jamesladd commented on May 26, 2024

from nuxt-serverless.

jamesladd avatar jamesladd commented on May 26, 2024

from nuxt-serverless.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.