Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the "setup" #472

Closed
wengcd opened this issue May 26, 2017 · 3 comments
Closed

How to use the "setup" #472

wengcd opened this issue May 26, 2017 · 3 comments

Comments

@wengcd
Copy link

wengcd commented May 26, 2017

https://github.com/vuejs/vue-cli/blob/master/docs/build.md#setup

witch file could be written?

module.exports = {
  setup(app) {
    app.get('/api', (req, res) => {
      res.end('This is the API')
    })
  }
}
@LinusBorg
Copy link
Member

Are you asking into what file you should add this code? Thius is explained here:

https://github.com/vuejs/vue-cli/blob/master/docs/build.md#configuration-files

@wengcd
Copy link
Author

wengcd commented Jun 13, 2017

I mean how to mock api

@LinusBorg
Copy link
Member

Then you might rather look at the proxy option:

https://github.com/vuejs/vue-cli/blob/master/docs/build.md#proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants