Skip to content

airtonix/vue-resource-mock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue-Resource-Mock

status: unstable, untested

fake backend when using vue-resource

Usage

// index.js

import Vue from 'vue';
import VueResource from 'vue-resource';
import VueResourceInterceptor from 'vue-resource-mock';

// your local route object
import Routes from './routes';

Vue.use(VueResource);
Vue.http.options.root = '/api';
Vue.http.interceptors.push(VueResourceInterceptor(Routes));

...
// rest of your Vue application.
// routes.js

export defaut {

    ['GET /api/hello'] (request, next) {
        let body = 'world!';
        next(request.respondWith(body, {status: 200}));
    },

};

Sources

Route Handlers

About

Backend mocking for rapid project testing and previews

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published