-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This tutorial will show you how to build a Pedestal application. The application which we will build is very simple and yet the process of building it will demonstrate some of the most important concepts of Pedestal.
The application will have a single button which, when clicked, will cause a counter to be incremented. Because Pedestal is designed for building rich, collaborative applications, we will make our simple counter app rich and collaborative. Any number of users will be able to connect to the server and everyone will see everyone else's counter. Once this is working, we will add a more interesting way of visualizing and interacting with this data.
This project will have both a client and server component. We will begin our work on the client.
The first step is to create a new Pedestal application project.
mkdir pedestal-app-tutorial
cd pedestal-app-tutorial
lein new pedestal-app tutorial-client no-comment
cd tutorial-client
Notice that we created an outer directory named
pedestal-app-tutorial to contain our project. We will eventually
have a client and server project within this directory.
The command lein new pedestal-app tutorial-client no-comment will
create a new app project named tutorial-client. The no-comment
argument will generate a project without all of the explanatory comments.
You can run this project by running
lein repl
and then in the REPL
(use 'dev)
(run)Open a browser and navigate to http://localhost:3000 to explore this
newly created project. This project hosts a very simple "Hello World"
application. To run the actual application, go to
http://localhost:3000/tutorial-client-dev.html.
To see the various aspects of your application project, use the Tools Menu in the lower right corner of the browser window (hover the mouse in the lower right corner to make the tools menu appear). As we go through this tutorial, the proper use of each aspect will become clear.
We are now ready to begin.
The tag for this step is step1.