dongmou9260 2014-02-06 18:29
浏览 38

Web服务器处理多个临时Scala脚本? [关闭]

For one of my simple appplications, all the routing is handled by nginx. I just put the php files in the directory referenced and they are serve requests: no framework is used. I am trying to migrate this scheme to Scala: I want to do it by gradually replacing each php script with one in Scala.

Is there a Scala counterpart of a php server that can automatically compile and serve all scala files under a directory? So that when I put code in /book/new.scala, /book/buy.scala, /user/login/auth.scala, etc, the server would compile and serve all of them for corresponding requests?

  • 写回答

2条回答 默认 最新

  • dsl2014 2014-02-06 19:12
    关注

    In the strictest technical sense, Scala can be used as a "scripting language," but it's rather limited in what can be reasonably done that way.

    As others have commented, you should make a proper server for or out of you Scala application. There are many options from simple and lightweight to big and fancy. Most use the Java Servlet Container, but some implement their own HTTP server side.

    You have many options to choose from, but "scripting" really is not among the viable ones.

    评论

报告相同问题?