Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

withgraphite/retyped-routes

Repository files navigation

Retyped routes (beta)

About

Retyped routes provides a type-safe way to create API definitions with retype in a way that can be read both by the server and client.

Install

yarn add @withgraphite/retyped-routes

Usage

import * as t from "@withgraphite/retype";
import { asRouteTree } from "@withgraphite/retyped-routes";

const API_ROUTES = asRouteTree({
  login: {
    method: "POST",
    url: "/auth",
    params: {
      email: t.string,
      password: t.string,
    },
    response: {
      token: t.string,
    },
  },
} as const);

export default API_ROUTES;

License

Copyright 2021, Screenplay Studios Inc.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •