Runable v1.0.0-alpha.20
Why Runable? Docs Modules Work with AI Blog About Changelog
  • 01Why Runable?
  • 02Docs
  • 03Modules
  • 04Work with AI
  • 05Blog
  • 06About
  • 07Changelog
Vue without a fixed server runtime.
Getting Started Structure Integrations Guide MCP API
  • Getting Started Structure Integrations Guide MCP API
      .output.apptsconfig.app.jsonapppageslayoutscomponentscomposablesglobalspluginsmiddlewarescssapp.vueerror.vuemodulesnode_modulespublic.env.gitignorerunable.config.tsserver.tspackage.jsontsconfig.jsontsconfig.node.json

app/middlewares

Control Vue navigation with global or named middleware.

Middleware runs during Vue Router navigation. Use it to check a session, redirect, or block access to a page.

// app/middlewares/auth.ts
export default defineVueMiddleware((to) => {
  const user = useCurrentUser();

  if (!user.value && to.path !== "/login") {
    return "/login";
  }
});

Then reference its name from the page:

definePageMeta({
  middleware: ["auth"],
});

A file with the .global.ts suffix applies to every navigation:

app/middlewares/analytics.global.ts

These middleware functions belong to the Vue router. HTTP middleware, API-route authentication, and request validation remain in your backend.

Report an issue Edit this page
plugins

Run code when each Vue application is created.

css

Organize global stylesheets loaded by Runable.

Runable

The Vue framework that brings productive conventions to any backend.

Product

  • Why Runable
  • Documentation
  • Installation
  • Integrations

Project

  • About
  • Blog
  • Changelog
  • Sponsor

Community

  • GitHub
  • Issues
  • Discussions
  • Bluesky

© 2026 Runable. Released under the MIT License.

Open source Built with Vue and Runable