fukamachi / caveman

Lightweight web application framework for Common Lisp.
http://8arrow.org/caveman/
782 stars 63 forks source link

Restarting the server automatically in the development process #117

Open asarch opened 4 years ago

asarch commented 4 years ago

How can I do that?

mdbergmann commented 4 years ago

Is that necessary?

mdbergmann commented 4 years ago

I use a fiveam fixture to start/stop the server for high-level test cases:

(def-fixture with-server ()
  (start)
  (sleep 0.5)
  (&body)
  (stop)
  (sleep 0.5))

(test handle-index-route
  "Test routing of index."
  (with-fixture with-server ()
    (is (str:contains? "<title>Foobar</title>" (dex:get "http://localhost:5000/")))
  ))
ghost commented 4 years ago

Hi. Can you please give more context? For example, when to actually restart this server and such.

rajasegar commented 3 years ago

Usually when we add new routes into the system, I would prefer to restart the server automatically with the new changes. This is a standard operating procedure in dev environments. In the Node JS there are several packages to do the same like nodemon, forever, pm2 , etc.,

vindarel commented 3 years ago

Developing with Hunchentoot inside Slime, any change to the server code, like adding or modifying a route, is available after a usual C-c C-c. Nothing needs to restart. It's the same with Caveman… right?

Restarting is only needed when we run the webserver in a terminal and we are not connected to Slime.