Phoenix + React: love story. RePh 2.
Roman Chvanikov
145

Nice writeup (alsopart 1)! :)

Just saw the comment

“# Following will throw an error but it will do what we need — to
# move all the files we have to “landing” directory. If you know a
# better way of doing this, let me know.”

I did it the following way:

cd web/static/

# create the “landing” subfolder in both folders “js” & “styles”. you’ll end up with “js/landing” & “styles/landing”

mkdir -p {js,styles}/landing

# move everything from js/* into js/landing (except the “landing” folder itself)

mv js/!(landing) js/landing/

# do the same for styles

mv styles/!(landing) styles/landing/

Just out of curiousity: Did you implement server side error handling in “web/static/js/landing/containers/index.js” so you can set proper response status codes (e.g. 400, 302,…)? I did come up with a solution but feels pretty complicated. So I just wonder if you implemented one yourself and I could compare it with mine

(maybe i’ll do a blog post about that as well when it turns out to be good enough)

best regard,

luke