oRPC is currently pre-stable, please report any issues on our Discord or GitHub 🚧
oRPC
background

Config

How to configure your oRPC project.

import {  } from '@orpc/contract'; // or '@orpc/server'
 
({
  : 'GET', // Default HTTP method for requests
  : 200, // Default HTTP status for successful responses
  : 'compact', // Input payload structure: 'compact' or 'expanded'
  : 'compact', // Output payload structure: 'compact' or 'expanded'
});

I recommend placing this script at the top of the main.ts file, where the server is initialized. Alternatively, include it at the top of the file where you define global oRPC builders or the app router. This ensures the configuration is applied before any other part of your code is executed.

On this page

No Headings