AE
Ash Elixir•2y ago
digzom

Ash Api without Phoenix setup

Hey folks. It's my first try on Ash Framework and I really liked the approach. I'm trying to build a basic REST API without a mix phoenix setup: - Receive requests through a controller - Do something (a api call to fetch some data, in my case) - Save the data - Return the data for the client I already figured out how to persist data with ash_postgres. But I'm having a hard time to understand how to create routes, because I don't want to setup a Pheonix App. In the documentation's "Getting started" only shows how to forward the call of a phoenix app. Is there some Ash helper to create routes, or even a separated phoenix package to help with this? Maybe the path is doing from scratch?
2 Replies
ZachDaniel
ZachDaniel•2y ago
Hello! So you don't want to use phoenix, but would you be okay using Plug? Thats all you technically need for ash_json_api and ash_graphql What we create is a Plug.Router, so you could create a very minimal plug setup and then use that 🙂
digzom
digzomOP•2y ago
Yep, I would be ok using Plug. Don't know why but I hadn't thought of that yet lol great! I will try and come back with updates later 😄 thx for your help

Did you find this page helpful?