artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue with MVC and templates


From: Jérémy Korwin-Zmijowski
Subject: Issue with MVC and templates
Date: Mon, 02 Nov 2020 12:22:33 +0100
User-agent: Evolution 3.36.4-0ubuntu1

Hi!

Waiting this for a while I am finally getting started with Artanis !!

So... I'm stuck right at the beginning. Tring to setup my index page
haha.

What I've done so far :

$ art work
$ art draw controller index

$ cat app/controllers/index.scm 
;; Controller index definition of mealadvisor
;; Please add your license header here.
;; This file is generated automatically by GNU Artanis.
(define-artanis-controller index) ; DO NOT REMOVE THIS LINE!!!

(get "/"
     (lambda ()
       (tpl->response "index.html.tpl")))

$ cat app/views/index/index.html.tpl 
<!doctype html>
<html lang="fr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
[…]

So I thought I was ready to 

$ art work
Loading conf/artanis.conf...done.
Session with SIMPLE backend init done!
Loading models...
Loading controllers...
Loading restful API...
Regenerating route cache ...
Server core: ragnarok
http://127.0.0.1:3000
Anytime you want to quit just try Ctrl+C, thanks!

Then hitting http://127.0.0.1:3000 returns :

[Client] GET / #<input-output: socket 18>
HTTP 500
Captured in </tmp/guix-build-artanis-0.4.1.drv-0/artanis-
0.4.1/artanis/page.scm>
Threw in procedure tpl-render-from-file :
[REASON] No such a tpl file `index.html.tpl'
[EXCEPTION] / is abnormal request, status: 500, rendering a sys page
for it...
[Remote] 127.0.0.1 @ 2020-11-02 12:21:38
[Request] method: GET, path: /, query: #f
[Response] status: 500, MIME: text/html

What did I miss ?

Thank you in advance.

Jérémy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]