Comments (7)
@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.
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.
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.
from nuxt-serverless.
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.
from nuxt-serverless.
from nuxt-serverless.
Related Issues (10)
- CloudFront? HOT 1
- Error 403 HOT 2
- Is this production-ready? HOT 1
- Static file serve progress? HOT 5
- 502 error only on first load after deploy
- Explain why disable gzip HOT 2
- Client side events after page render HOT 1
- Using nuxt-ts HOT 1
- Explain Management Issues HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt-serverless.