A basic, yet suffient, blog app written in ClojureScript - created for the Workshop at Bangalore Clojure meetup on April 6, 2019.
The idea is that people should be able to build on top of it.
Blogs are just markdown files in the resources/md
folder, and any images used are in the resources/public/img
folder. Therefore, no database setup is required. When you add a new blog, just update the articles
data in the src/cljs/db.cljs
file.
lein clean
lein figwheel dev
Figwheel will automatically push cljs changes to the browser.
Wait a bit, then browse to http://localhost:3449.
- Create heroku free account
- Install Heroku CLI
- Login to Heroku:
heroku login
. Make sure you are in the app directory at the terminal. - Create a Heroku app:
heroku create
. You can see your created app in your Heroku account dashboard. Now, go to your heroku dashboard, and click on the app you created. Then go to thesettings
tab and check thename
section - if you would like to edit, do it now. - If you haven't initialized
git
for you app, rungit init
. - Run
lein clean
- Add all of your app files for commit:
git add -A
. You can check the status of the files that will be added for commit by runninggit status
. - Commit all files:
git commit -m "add some meaningful text here"
- Deploy to Heroku:
git push heroku master
- In order to push further changes, just redo steps 6, 7, 8, and 9 after any changes you make.
Now, you can see your app running on the url mentioned in the Domains and certificates
of the settings
page. As a shortcut, you could also run heroku open
.
If you wish to keep your app in your personal git repo, you just have to add the remote url of your newly created git repo by running git remote add origin <your-git-repo-url>
, and do the following:
- Steps 6, 7, and 8 from above
- Then,
git push -u origin master
. Rather than deploying to Heroku, you are pushing updates to your git repo.
lein clean
lein with-profile prod uberjar
That should compile the clojurescript code first, and then create the standalone jar.
When you run the jar you can set the port the ring server will use by setting the environment variable PORT. If it's not set, it will run on port 3000 by default.