Skip to content

Small example project? #91

Closed
Closed
@ptaoussanis

Description

@ptaoussanis

Hi Zhang,

Have you thought to maybe include some kind of simple example project for users to download + run to experiment with (learn) nginx-clojure?

The quick start guide looks good, but maybe still a bit intimidating (scary) for people who are not familiar with configuring nginx modules, etc.?

For example, in the quick start guide, you have an inline handler like:

(fn[req]
  {:status 200,
   :headers {"content-type" "text/plain"},
   :body  "Hello Clojure & Nginx!"})

But as a Clojure developer - I think: how can I connect nginx-clojure to my Clojure application if I am using a Compojure router, etc. The documents say this is possible, but I could not find somewhere to say exactly how?

So maybe a useful example project could include:

  1. A small Clojure application using Compojure and a few routes with simple text responses: "route 1 response", "route 2 response", etc.
  2. The right nginx.conf for this small Clojure application.
  3. Any special startup scripts that may be needed.
  4. Maybe some comments about: is there anything special we need to do for sessions, etc.

Some questions that I still have after looking at the documents:

  1. Is it possible to convert any standard Jetty Clojure application to use nginx-clojure?
  2. Is this usually difficult (it needs a lot of work), or is it usually quite easy?
  3. Are there any limitations (problems/disadvantages) with using nginx-clojure instead of something like Jetty or http-kit?
  4. Is better performance the main advantage to using nginx-clojure instead of something like Jetty or http-kit?

The nginx-clojure performance looks very good. I think probably some Clojure developers would look more closely at nginx-clojure if these few things could be a bit more clear.

Does that make sense?

I hope these comments are useful, good luck with the project!

(Also, I will try release the new Sente version later today).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions