Pass the posts branching switching stuff into app.js