Skip to content

Instantly share code, notes, and snippets.

@mathieutu
Created March 5, 2019 16:38
Show Gist options
  • Select an option

  • Save mathieutu/dfd6eddee9b08615831c7a19214a6f59 to your computer and use it in GitHub Desktop.

Select an option

Save mathieutu/dfd6eddee9b08615831c7a19214a6f59 to your computer and use it in GitHub Desktop.
Nuxt v1 https
const { Nuxt } = require('nuxt')
const https = require('https')
const { readFileSync } = require('fs')
const port = 443
const config = require('./nuxt.config.js')
const nuxt = new Nuxt(config)
const options = {
key: readFileSync('/home/store/certs/store.key'),
cert: readFileSync('/home/store/certs/store.crt')
};
https
.createServer(options, nuxt.render)
.listen(port)
console.log('Server listening on `localhost:' + port + '`.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment