How to deploy and run clojurescript application in Heroku - heroku

I have a template of a clojurescript application from https://github.com/Day8/re-frame-template. So I want to deploy that template without any modifications to Heroku. So I followed the instructions on the README
lein clean lein cljsbuild once min. Then I follow the instructions on Heroku as well on deploying clojure on https://devcenter.heroku.com/categories/clojure-support
But when I check if the application runs all I get is an application error.
So my questions are:
How does one build and deploy a clojurescript app to heroku?
What is the difference in deploying a clojurescript app vs a clojure app
Do I need a clojure server in order to run clojurescript?
How does one even run a standalone clojurescript app on the desktop?
How is the generated app.js related to running a clojurescript app?
I have found it pretty easy to deploy and run a clojure app on Heroku as well as a standalone applicaton on my desktop, I was hoping the same would be true for clojurescript.
Edited:
The error is here: https://floating-depths-33030.herokuapp.com/

To clear the topic for future people finding heroku + clj/cljs, following is a list of working examples. The clojure support on heroku means you can have Clojure webapp deployed. But cljs (like re-frame) actually is pure javascript, have nothing to do with heroku clojure support.
https://github.com/kawasima/back-channeling
https://github.com/zerg000000/table-tmpl

To deploy a re-frame application to Heroku one needs a clojure server, this is where ring comes in. In order to add ring one needs to add +handler while creating a new re-frame project as so:
lein new re-frame <project-name> +handler
This will create a project with a configuration that allows it to be deployable to Heroku.
Steps to deploy to Heroku:
lein clean
lein with-profile prod uberjar
git init
git add .
git commit -m "first commit"
git push heroku master
heroku ps:scale web=1
heroku open
This is application is now readily accessible.

Related

Prevent building backend in Heroku when frontend is modified

Hello i have a repository with the following structure:
/backend
/frontend
I want to allow Heroku builds and deploy only when changes are made in backend subdirectory.
I have configured heroku build pack : https://github.com/timanovsky/subdir-heroku-buildpack.git
Adding the env PROJECT_PATH=backend
Heroku successfully builds the subdirectory "backend" (when pushing my branch) but the problem is that it is also building and deploying when a changes are made in the "frontend" subdirectory.

Changes not reflecting on browser after deploying code on heroku node js app

I have an app on Heroku. According to the Heroku App deploy guide I followed the below steps to modify the master.
Steps to make the push on Heroku
$ git add .
$ git commit -am "make it better"
$ git push Heroku master
The build of deploy was successful but the changes didn't reflect on the browser. I used hard refresh multiple times but didn't work.
If your app requires a build step to compress and combine assets and you are not seeing recent changes, then it's likely that you are forgetting to run that build step.
If you are using package such as parcel-bundler. you should run it before you deploy it. That would solve the issue.
You can read more on how to run it automatically whenever you deploy your app from here.
https://devcenter.heroku.com/articles/node-best-practices#hook-things-up

Deploying my Java Dynamic Web Project to Heroku

I've been trying to deploy a dynamic web project created in Eclipse to Heroku but I've been having a few difficulties. This project does not use a pom file/maven and does not seem to work with any of the java buildpacks that I try to use. I added a jvm buildpack and this appeared to help my project pass deployment, but when I try to open my app, I get the following error:
"Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail"
Is there a specific buildpack that I should use for this project?

Deploy WebSharper.Suave web application to Heroku

I can not understand what I need to change to make it.
I created a demo project from this blogpost with app.json and Procfile:
web: fsharpi-heroku WebsahrperSuaveHerokuExample1.sln
Next, I tried to deploy it to Heroku in accordance with these recommendations:
heroku create websahrper-with-suave-example --buildpack https://github.com/SuaveIO/mono-script-buildpack.git
heroku git:remote -a websahrper-with-suave-example
git push heroku master
There was an error in Heroku when building the project:
...
Import process completed.
-----> packages.config found, installing dependencies with nuget
Cannot open assembly 'install': No such file or directory.
! Push rejected, failed to compile SuaveFramework app
Could you suggest me a solution if there is one?
Have you tried here:
https://github.com/SuaveIO/heroku-getting-started
Fork it and click the Deploy to Heroku button.
Don't have the rep to comment on the above, but ademar's solution should cover as well as long as you don't have a file named "app.fsx"
The heroku buildpack checks to see if there is a script, then checks for a solution:
https://github.com/SuaveIO/mono-script-buildpack/blob/master/bin/compile#L66
Just make sure there is a .sln file in the project directory (can be empty, just needs to be present) or fork the buildpack and just make it default run mono $YOURPROJECT in the compile step.
When using an sln instead of a script, you need to change your Procfile to:
web: mono Path/execName.exe

Can I have a playframework 2.0 webapp and a maven based worker process on heroku?

I have an existing webapp on heroku that needs to send messages to a queue. I want a worker to pick the messages up and process them. After reading the example on https://devcenter.heroku.com/articles/run-non-web-java-processes-on-heroku I figured running another play process through the Procfile would be wasteful, so I made the following project structure to just use maven for the worker instead:
[git root]
+--[play 2.0 app]
| + (project files)
| +-Procfile (web)
|
+--[maven based worker]
+ (project files)
+-Procfile (worker)
Now if I try to push all of this to heroku it fails miserably. Heroku thinks this is a play 1.2.4 project and then just falls apart. When I try to specify a play 2.0 buildpack it says "no Cedar-supported app detected". So obviously heroku doesn't like my directory structure.
I want my play app and my maven worker to share the same git repository and if possible, be part of the same deployment to heroku. Is there a common pattern to solve this problem?
You can't mix multiple buildpacks in a single app on Heroku. Instead you could do this all as a Play 2 app. Here is an example project that will help get you started:
https://github.com/jamesward/play2-scheduled-job-demo

Resources