Skip to content
Starter template for Nuxt.js with SailsJS. https://nuxtjs.org
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
template await nuxt.ready() Apr 5, 2019
README.md fix line ending Jan 24, 2019
meta.js generating a random session secret for session.js config file Jan 24, 2019

README.md

Nuxt.js with Sails

SailsJS + Nuxt.js = ⚡️

Installation

This is a project template for vue-cli.

vue init tarrask/sails-template <project-name>
cd <project-name> # move to your project
npm install # or yarn install*[see note below]

Make sure to use a version of vue-cli >= 2.1 (vue -V).

If you are using vue-cli >= 3.0, you have to install a global bridge:

npm install -g @vue/cli-init

*Note: Due to a bug in yarn's engine version detection code if you are using a prerelease version of Node (i.e. v7.6.0-rc.1) you will need to either:

  1. Use npm install
  2. Run yarn with a standard release of Node and then switch back

Commands

Command Description
npm run dev Lift sails server in development with Nuxt.js in dev mode (hot reloading). Listen on http://localhost:1337.
npm run build Build the nuxt.js web application for production.
npm start Start sails server in production.

Configuration

The nuxt.config.js is located in the config/nuxt.js to follow sails convention and to use it from a sails hook.

To access the sails backend from nuxt, you can use the axios. It is preconfigured by the hook to point to the sails port. For it to work from the client, you may need to add proxy: true to nuxt.js

module.exports.nuxt = {
  modules: [ '@nuxtjs/axios' ],
  axios: {
    proxy: true
  }
}

Documentation

Links

Licenses

You can’t perform that action at this time.