🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

nuxt-server

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-server

HTTP and HTTPS server for nuxt

1.1.1
latest
Source
npm
Version published
Weekly downloads
9
-50%
Maintainers
1
Weekly downloads
 
Created
Source

What is nuxt-server?

It is HTTP and HTTPS server for nuxt.

Setup

nuxt.config.js

// ... code ...
cert: {
  mode: 'http', // HTTP (default), HTTPS, HTTP_HTTPS
  setup: {
    http: {
      port: 8080 // default
    },
    https: {
      port: 8443,// default
      path: {
        key: './path/to/file/example.key', // Path to the certificate key
        cert: './path/to/file/example.crt', // Path to the certificate
        ca: ['./path/to/file/example.txt'] // Path to the certificate
      },
      handshakeTimeout: 120,
      requestCert: false,
      rejectUnauthorized: true
    }
  }
}

OU

export CERT_MODE=http
export HTTP_PORT=8080
export HTTPS_PORT=8443
export PATH_KEY=./path/to/file/example.key
export PATH_CERT=./path/to/file/example.crt
export PATH_CA=./path/to/file/example.txt
export HANDSHAKE_TIMEOUT=120
export REQUEST_CERT=false
export REJECT_UNAUTHORIZED=true

server.js

// Require `Nuxt` And `Builder` modules
const {Nuxt, Builder} = require('nuxt');

const NuxtServer = require('nuxt-server');
// Require Nuxt config
const config = require('../nuxt.config.js');

const server = new NuxtServer(Nuxt, Builder, config);
// ---
server.run(function(err, ports) {
  if (err) console.error(err);
  console.log(ports);
});
// OR
const psRun = server.run();
psRun.then(function(ports) {
  console.log(ports);
});
psRun.catch(function(err) {
  console.error(err);
});
// ---

package.json

"scripts": {
  // ... code ...
  "start": "node server.js"
},

Keywords

nuxt

FAQs

Package last updated on 15 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts