Skip to content

eerohele/gae-clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clojure on Google App Engine: Hello World

This is a sample project that showcases how to deploy a Clojure web application into Google App Engine.

For a Leiningen version of this project, see the lein branch of this repository.

NOTE: See all the files in this repository for comments regarding the various fiddly bits (app.yaml in particular).

Prerequisites

You must have these command-line tools installed:

Additionally, before continuing, you must authorize Google Cloud SDK Tools.

Steps

These steps assume the project ID of your GCP project is foo-bar-123456. Replace the ID with your own project ID when running these commands.

There are other ways of specifying the project ID. See the gcloud CLI docs.

  1. Create a new Google Cloud Platform project:

    $ gcloud projects create foo-bar-123456
  2. Create a new App Engine app:

    $ gcloud app create --project=foo-bar-123456

    In the prompt that appears, select the region where you want to deploy the app.

  3. Create an uberjar:

    $ clj -A:uberjar
  4. Copy app.yaml into the target directory:

    $ cp app.yaml target
    # This seems a bit inelegant, but I haven't figured out a better way.
    #
    # This is necessary because app.yaml and the deployable artifact need
    # to be in the same directory.
  5. Deploy the application:

    $ gcloud app deploy --project=foo-bar-123456 target
  6. Open the app in your browser:

    $ gcloud app browse --project=foo-bar-123456

    The first request's gonna take a while.

About

Deploying a Clojure web app into Google App Engine Standard Environment — a minimal example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published