Syro

12. Running a webserver

12. Exécuter un serveur web

Finally, we will be able to see our application in the browser. Save the following code to config.ru:

Enfin, nous allons pouvoir voir notre application dans le navigateur. Sauvegardez le code suivant dans config.ru:

  require "syro"

  App = Syro.new do
    get do
      res.text "hello, world"
    end
  end

  run(App)

Start the server with the following command:

Démarrez le serveur avec la commande suivante :

  $ rackup

Now, point your browser to http://localhost:9292.

Maintenant, dirigez votre navigateur vers http://localhost:9292.


Prev | Index | Next

Précédent | Sommaire | Suivant