-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Clojure Web Development Essentials
By :
Before we can view a page, we have to be able to serve it. We'll be creating a couple of album-related pages in hipstr. So let's create a new hipstr.routes.albums namespace, and also create a route to serve up a page for the /albums/recently-added URL:
Create a new hipstr.routes.albums namespace in the hipstr/routes directory. As with our other route namespaces, we'll be making use of Compojure for creating the route, as well as album-model to retrieve the recently added albums from the database:
(ns hipstr.routes.albums
(:require [compojure.core :refer :all]
[hipstr.layout :as layout]
[hipstr.models.album-model :as album]))Next, we'll define a new album-routes defroute that will encapsulate all our albums-related routes for hipstr:
(defroutes album-routes (GET "/albums/recently-added" [] (album/get-recently-added)))
Finally, we have to add the new album-routes to the hipstr app-handler:
Open the hipstr/handler.clj file and add a reference...
Change the font size
Change margin width
Change background colour