* [Potluck] a lightweight web framework
@ 2013-02-17 5:03 Nala Ginrut
2013-02-17 6:14 ` Daniel Hartwig
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Nala Ginrut @ 2013-02-17 5:03 UTC (permalink / raw)
To: guile-devel; +Cc: guile-user
Sorry for the late guys!
I planed to give you a lightweight web-framework, and you may use it to
build your own site with Guile easily. Besides, with Guile's inner
web-server, you could have 10K concurrency performance.
But life is no so perfect, I was sick for few days, so I'm late for the
potluck. When I tried to polish it more beautiful, I found a bug in web
module (anyway it's a nice discover for a hacker).
Seems that I have to release it as a half-baked one :-(
But good news is that I'll continue to polish it.
I put here:
https://gitorious.org/glow/artanis
Let me introduce it:
* very lightweight: the core artanis.scm almost 300 lines, easy to hack
and learn for newbies.
* a relative complete web-server implementation, include error page
throw and all the HTTP method(you have to specify your own handler)
* 10K concurrent performance for the server, takes advantage of the
Guile inner server. IIRC, andy once said it's 9K+ for static pages.
It's enough for you own site/blog.
* sinatra like style route, that's why it names "artanis" ;-)
* Database support(now use guile-dbi), mysql/sqlite/postgresql. But it's
easy to port to other database binding. (but I like dbi)
* session support (thanks for andy's advice)
* HTML template of SXML (very easy to use for Lisper)
I have no time to write a tutorial for it before I release, but there'll
be one soon. And you may read test.scm/blog.scm to get to know how it
works.
https://gitorious.org/glow/artanis/blobs/master/test.scm
https://gitorious.org/glow/artanis/blobs/master/blog.scm
(for blog.scm, you may need blogdb.mysql script to build your database
quickly)
You may write a blog in ten minutes if you're familiar with web develop
and SQL.
PS: and I have to mention that bug, I believe it's a bug.
When the server-handler get the request, I found the uri in request have
no 'host', it's #f. It causes trouble for me to implement url redirect
mechanism, which used to implement admin authentication.
I do think uri should keep 'host' value because it's useful for later.
And it's OK for 'read-request-line', it'll parse and store 'host'
correctly.
I think there's some link in the inner server module, which dropped
'host' value or created a new uri and throw the old-correct one.
Any comments?
Sorry again for the half-baked work, it looks no cool. But I've ever
planed a perfect one... :-(
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Potluck] a lightweight web framework
2013-02-17 5:03 [Potluck] a lightweight web framework Nala Ginrut
@ 2013-02-17 6:14 ` Daniel Hartwig
2013-02-17 6:50 ` Nala Ginrut
2013-02-17 6:18 ` Daniel Hartwig
2013-02-19 7:33 ` Nala Ginrut
2 siblings, 1 reply; 5+ messages in thread
From: Daniel Hartwig @ 2013-02-17 6:14 UTC (permalink / raw)
To: Nala Ginrut; +Cc: guile-user, guile-devel
On 17 February 2013 13:03, Nala Ginrut <nalaginrut@gmail.com> wrote:
> PS: and I have to mention that bug, I believe it's a bug.
>
> When the server-handler get the request, I found the uri in request have
> no 'host', it's #f. It causes trouble for me to implement url redirect
> mechanism, which used to implement admin authentication.
> I do think uri should keep 'host' value because it's useful for later.
> And it's OK for 'read-request-line', it'll parse and store 'host'
> correctly.
Most HTTP requests will *not* include an absolute URI. Instead, the
request line contains only the path. This is not a bug.
There is a header, host, that can be used to fill in the blank /if it
is present/. Doing this automatically in the web module is too
prescriptive; instead, each server should do this for itself as it
deems appropriate. Also, I would just inspect the host header
directly and *never* manipulate the Request-URI.
<http://tools.ietf.org/html/rfc2616#section-5.1.2>
The host header is typically used by a reverse proxy or virtual host
provider to dispatch to the appropriate site handler/module, which
(usually) should not care what its hostname is.
>
> I think there's some link in the inner server module, which dropped
> 'host' value or created a new uri and throw the old-correct one.
> Any comments?
What makes you think that?
>
>
> Sorry again for the half-baked work, it looks no cool. But I've ever
> planed a perfect one... :-(
>
Lets see it get finished then :-)
Regards
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Potluck] a lightweight web framework
2013-02-17 6:14 ` Daniel Hartwig
@ 2013-02-17 6:50 ` Nala Ginrut
0 siblings, 0 replies; 5+ messages in thread
From: Nala Ginrut @ 2013-02-17 6:50 UTC (permalink / raw)
To: Daniel Hartwig; +Cc: guile-user, guile-devel
hi Daniel!
First, I must appreciate for your encourage! That makes me happier
though I'm still weak and headache. ;-)
On Sun, 2013-02-17 at 14:14 +0800, Daniel Hartwig wrote:
> On 17 February 2013 13:03, Nala Ginrut <nalaginrut@gmail.com> wrote:
> > PS: and I have to mention that bug, I believe it's a bug.
> >
> > When the server-handler get the request, I found the uri in request have
> > no 'host', it's #f. It causes trouble for me to implement url redirect
> > mechanism, which used to implement admin authentication.
> > I do think uri should keep 'host' value because it's useful for later.
> > And it's OK for 'read-request-line', it'll parse and store 'host'
> > correctly.
>
> Most HTTP requests will *not* include an absolute URI. Instead, the
> request line contains only the path. This is not a bug.
>
> There is a header, host, that can be used to fill in the blank /if it
> is present/. Doing this automatically in the web module is too
> prescriptive; instead, each server should do this for itself as it
> deems appropriate. Also, I would just inspect the host header
> directly and *never* manipulate the Request-URI.
>
> <http://tools.ietf.org/html/rfc2616#section-5.1.2>
>
> The host header is typically used by a reverse proxy or virtual host
> provider to dispatch to the appropriate site handler/module, which
> (usually) should not care what its hostname is.
>
> >
> > I think there's some link in the inner server module, which dropped
> > 'host' value or created a new uri and throw the old-correct one.
> > Any comments?
>
> What makes you think that?
>
Well, I thought 'host' should be kept, and 'read-request-line' works, so
I guess it was dropped somewhere.
OK, if it's not a bug, I think I should avoid to run build-request
again, but modify the original uri an pass the original request. Since
it'll check the validity, it throw error if 'host' is #f. Is that
accepted?
> >
> >
> > Sorry again for the half-baked work, it looks no cool. But I've ever
> > planed a perfect one... :-(
> >
>
> Lets see it get finished then :-)
>
> Regards
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Potluck] a lightweight web framework
2013-02-17 5:03 [Potluck] a lightweight web framework Nala Ginrut
2013-02-17 6:14 ` Daniel Hartwig
@ 2013-02-17 6:18 ` Daniel Hartwig
2013-02-19 7:33 ` Nala Ginrut
2 siblings, 0 replies; 5+ messages in thread
From: Daniel Hartwig @ 2013-02-17 6:18 UTC (permalink / raw)
To: Nala Ginrut; +Cc: guile-user, guile-devel
On 17 February 2013 13:03, Nala Ginrut <nalaginrut@gmail.com> wrote:
> I put here:
> https://gitorious.org/glow/artanis
The examples you mentioned make this look very interested. Nice job.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Potluck] a lightweight web framework
2013-02-17 5:03 [Potluck] a lightweight web framework Nala Ginrut
2013-02-17 6:14 ` Daniel Hartwig
2013-02-17 6:18 ` Daniel Hartwig
@ 2013-02-19 7:33 ` Nala Ginrut
2 siblings, 0 replies; 5+ messages in thread
From: Nala Ginrut @ 2013-02-19 7:33 UTC (permalink / raw)
To: guile-devel; +Cc: guile-user
Hey guys!
Now it's the time to officially release my potluck dish:
https://github.com/NalaGinrut/artanis
Let me re-introduce it:
* just read the README on the link I gave ;-P
Happy hacking!
Enjoy!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-02-19 7:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-17 5:03 [Potluck] a lightweight web framework Nala Ginrut
2013-02-17 6:14 ` Daniel Hartwig
2013-02-17 6:50 ` Nala Ginrut
2013-02-17 6:18 ` Daniel Hartwig
2013-02-19 7:33 ` Nala Ginrut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).