title: Handling endpoints APIs on client side instead of serverMiddleware in Nuxt
body: <p>I'm on Nuxt 2.15.8 and trying to build an offline app with electron.js and prisma+sqlite for local DB.</p>
  <p>In nuxt to hit a local endpoint there is a common way of using serverMiddleware and express like this:</p>
  <pre class="lang-js prettyprint-override"><code>// api.js that will be added to nuxt.config.js file as serverMiddleware
  import express from 'express'
  const app = express()
  
  app.use(express.json())
  
  export default {
    path: '/api',
    handler: app
  }
  </code></pre>
  <p>which send endpoints beginning with <code>api/</code> through <code>app</code> handler which I can use to access my BD (the common way to access sqlite3 DB is the same)</p>
  <pre class="lang-js prettyprint-override"><code>// added to api.js
  import { PrismaClient } from '../../resources/prisma/client'
  
  const prisma = new PrismaClient()
  app.get(`/user/info`, async (req, res) =&gt; {
    const result = await prisma.user.findUnique({
      where: {
        id: 1,
      },
    })
    console.console.log(res);
    res.json(result)
  })
  
  </code></pre>
  <p>this will work fine on nuxt, also fine on nuxt-electron <code>dev</code> mode. but on built <code>exe</code> file serverMiddleware won't be called. So as it has be done by others (nuxt-electron accessing offline local DB) there must be a way to define endpoints on client side. any idea??</p>
  <p><strong>Updated:</strong></p>
  <p>as I changed my Nuxt-Electron boilerplate I could access serverMiddleware in <code>exe</code> file but it wont hit the endpoints yet!</p>