supabase-community / nuxt-supabase

A supa simple wrapper around Supabase.js to enable usage within Nuxt.
https://supabase.io
MIT License
167 stars 17 forks source link

How to access supabase in server-middleware api? #18

Open skwasan opened 2 years ago

skwasan commented 2 years ago

How to access the nuxt supabase module in server-middleware/rest.js?

//rest.js

app.all('/getJSON', async (req, res) => { console.log('req', req.apikey) console.log(supabase) const { data, error } = await supabase .from('userdetails') .select('config') .eq('apikey', req.apikey) res.json({ data: data }) })