diff --git a/app.moon b/app.moon index 0b17bab..20233ba 100644 --- a/app.moon +++ b/app.moon @@ -10,8 +10,9 @@ import respond_to from require "lapis.application" require "models.user" class App extends lapis.Application - "/": => - render: "index" + [index: "/"]: => + @user = @session.user + render: true [list: "/list"]: => user = Users\find id: @session.user @@ -38,7 +39,7 @@ class App extends lapis.Application @params.extension = "9001" if Users\find email: @params.email - return "User with that email already exists" + return status: 500, "User with that email already exists" user = Users\create @params user\write_session @ diff --git a/views/index.moon b/views/index.moon index 3f8de32..7070dbb 100644 --- a/views/index.moon +++ b/views/index.moon @@ -5,3 +5,6 @@ class Index extends Widget h1 class: "header", "Hello" div class: "body", -> text "Welcome to my site!" + + if @user + h2, "I think you are UID #{@user}"