Packaging of dgraph ratel


(Aman Mangal) #1

Hi,

I am really curious how dgrpah ratel is packaged given that all files go into just 1 binary including the js, html and css files.

Some background, I built one application using react js as front end and golang as backend. When I tried using golang server to serve the react js files, the routes didn’t work well with the golang server. I am wondering how that is handled?

I am also curious about what technique are you using to embed the js files into binary. Pointing to an article etc. will help as well

Thanks
Aman Mangal


(James) #2

you may use some framework like gobuffalo todo this


(Aman Mangal) #3

They use packr for embedding assets into binary. What about routes? Won’t that be a problem for a HTTP Server? I get that serving files is straight forward though.


(James) #4

i think its abit off topic,

routes is also part of the framework
https://gobuffalo.io/en/docs/routing


(Paul Korzhyk) #5

We use Webpack to transpile & bundle js, jsx, css, etc files.
There are multiple ways to configure that, for Ratel we used the create-react-app script.

Webpack output is then packaged into go assets using go-bindata.