Bootstrapping a web server in Scala

后端 未结 8 1719
走了就别回头了
走了就别回头了 2021-02-01 10:32

The following is possible using Python:

$ apt-get install python
$ easy_install Flask
$ cat > hello.py
from flask import Flask
app = Flask(__name__)

@app.rou         


        
8条回答
  •  猫巷女王i
    2021-02-01 10:59

    Scala equivalent is in 6 commands:

    $ curl https://raw.github.com/n8han/conscript/master/setup.sh | sh
    $ ~/bin/cs n8han/giter8
    $ ~/bin/g8 scalatra/scalatra-sbt --name=scalatra-example
    $ cd scalatra-example
    $ wget http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/0.11.0/sbt-launch.jar
    $ java -Xmx512M -jar sbt-launch.jar ~jetty-run
    

    Using Play,

    step #1 download Play, then
    $ play install scala
    $ play new myproject --with scala
    $ play run myproject
    

提交回复
热议问题