---
title: "Comment by Mykolas Mankevicius on \"Adding a Laravel backend to a Remix App\" | Hashnode"
description: "Do you have an example of how you setup the api.post stuff?"
url: "https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798/comment/632c1e19e06c24f9f23a3d71"
---

[Discussion](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798)

Comment [Adding a Laravel backend to a Remix App](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798)

[Mykolas Mankevicius](https://hashnode.com/@TheMykolas)

[Sep 22, 2022](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798/comment/632c1e19e06c24f9f23a3d71)

Do you have an example of how you setup the api.post stuff?

[Dave Calnan](https://hashnode.com/@davecalnan)

[Sep 26, 2022](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798/comment/632c1e19e06c24f9f23a3d71#reply-63315f874dd8b2344a768860)

I actually extracted this into its own npm package:

[github.com/davecalnan/typesafe-api/tree/main/pack…](https://github.com/davecalnan/typesafe-api/tree/main/packages/typesafe-api-client)

```
yarn add @davekit/typesafe-api-client
```

It's basically just:

```
export const api = createApiClient({
  baseUrl: "your-app.com/api"
});

const result = api.get("/some-path");

const onClick = () => api.delete("/some-other-path");
```

I pair it with `@davekit/typesafe-api` and generate types for all my backend routes that I can then import into the frontend and get type-safety over the API. But that needs a whole blog post of its own to get into.
