Use API Laravel in the quasar mobile application

  • There is an application for quasar. I’m building an app for android.
    The backend on the laravel. I indicate in the quasar settings

    devServer: {
    open: true, // opens browser window automatically
    proxy: {
    ‘/ api’: {
    target: ‘http: // domain_name’,
    changeOrigin: true
    // pathRewrite: {
    // ‘^ / api’: ‘’

    I copy the resulting application to a smartphone, the login and password input window is displayed, but the router does not work, more precisely, I assume that the action in vuex does not work: (’/ api / auth / login’, {
    login: login,
    clientID: clientID + ‘’,
    key: key + ‘’

    I have an assumption that the links to api must be indicated somehow differently so that they work in a mobile application.

    Help me figure out how to make applications that have a frontend on a quasar and a backend on laravel.

  • @devspo you are taking that example wrong, it’s for when you use a spa frontend along with your backend on same domain, which in mobile shouldn’t work since your app is served within your mobile phone via file://. now if you want to communicate with your backend then you’ll have to supply a full url in the url params of an axios function, or use a baseUrl in your axios setup. pls head to axios docs to learn more on how to do that.

Log in to reply