A nuxt.js fastify plugin
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pages
.babelrc Initial commit Sep 8, 2018
.eslintrc.js
.gitignore
.npmignore
.travis.yml CI Sep 30, 2018
LICENSE
Readme.md
ex.js
index.d.ts
index.js
package.json 1.2.3 Oct 2, 2018
test.js
yarn.lock

Readme.md

fastify-vue-plugin

A nuxt.js fastify plugin

NpmLicense David GitHub package version NPM Link Greenkeeper badge

Installation

yarn add fastify-vue-plugin
# or if you use npm
npm i fastify-vue-plugin --save

Usage

const fastify = require('fastify')();

fastify.register(require('fastify-vue-plugin'), {
    config: require('./nuxt.config.js')
}).after(e => {
    if (e) console.trace(e);
    fastify.nuxt('/'); // is equals: index.vue
    fastify.nuxt('/dashboard');
    // add all your nuxtjs routes
    // make sure there are added in the after function
    
    // use params
    fastify.nuxt('/product/:id');
});

// other stuff/routes

fastify.listen(1337, '0.0.0.0' , (e) => {
    if (e) console.trace(e);
    console.warn('http://0.0.0.0:1337');
});

Notice

This plugin is inspired by the fastify-react plugin.

License

The MIT License (MIT)

Copyright (c) 2018 Nils Bergmann

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.