!IMPORTANTThis mode is currently not our priority. We are currently concentrating fully on the Full-stack Playground Template. Development on standalone backend-only may restart if there is significant interest from users of other frameworks (e.g., React.js).
If you are using Nuxt as a backend for a separate client application (e.g., mobile app, SPA), you can use this module to quickly expose REST APIs.
In this case, you might handle authentication differently (e.g., validating tokens in middleware) or disable the built-in auth checks if you have a global auth middleware.
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-auto-crud'],
autoCrud: {
schemaPath: 'server/db/schema',
// auth: false, // Uncomment this line for testing APIs without auth
auth: {
type: 'jwt', // for app providing backend apis only
authentication: true,
authorization: true,
jwtSecret: process.env.NUXT_JWT_SECRET || 'test-secret-key-123',
},
},
})
Note: Remember to add your NUXT_JWT_SECRET in .env.
You should also configure drizzle.config.ts correctly:
// drizzle.config.ts
import { defineConfig } from 'drizzle-kit'
export default defineConfig({
dialect: 'sqlite',
schema: './server/db/schema/index.ts',
out: './server/db/migrations',
tablesFilter: ['!_hub_migrations'],
})