FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

Documents / @faasjs/dev / viteFaasJsServer

Function: viteFaasJsServer()

viteFaasJsServer(): Plugin

Create a Vite plugin that forwards POST requests to an in-process FaasJS server.

The plugin resolves server settings from src/faas.yaml, strips the Vite base prefix from request URLs, restarts the in-process server when source files change, and refreshes generated route declarations for @faasjs/types.

Returns

Plugin

Vite plugin instance for local FaasJS development.

See

generateFaasTypes

Example

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { viteFaasJsServer } from '@faasjs/dev'

export default defineConfig({
  plugins: [react(), viteFaasJsServer()],
})