1.0.0-rc.1 • Published 6 years ago
next-serverless-server v1.0.0-rc.1
Next.js Serverless Server
A plain Node.js server that serves a Next.js app built for the serverless target.
Installation
npm install --save next-serverless-serverUsage
const server = require('next-serverless-server')
server(__dirname).listen(3000, (err) => {
if (err) throw err
console.log('> Ready on http://localhost:3000')
})API
server(root: string): http.Server
Creates a new http.Server with a request handler attached for serving the Next.js app.
The root argument should be the path to the folder of your app, that is the folder that contains the .next folder.
Note that your Next.js app must be built with the target: 'serverless' option specified.
1.0.0-rc.1
6 years ago