Created
April 14, 2018 21:57
-
-
Save fernyettheplant/2a487947818c792078ab0cfa7ccd2b5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const {Nuxt} = require('nuxt') | |
const path = require('path') | |
const awsServerlessExpressMiddleware = require('aws-serverless-express/middleware') | |
// Create App | |
const app = express() | |
// Set API Gateway Middleware | |
app.use(awsServerlessExpressMiddleware.eventContext()) | |
// Provide Assets | |
app.use('/_nuxt', express.static(path.join(__dirname, '.nuxt', 'dist'))) | |
// Add Nuxt | |
let config = require('./nuxt.config.js') | |
const nuxt = new Nuxt(config) | |
app.use(nuxt.render) | |
module.exports = app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment