Scala로 Play Framework 프로젝트 만들기

4098 단어 PlayFrameworkScala

전제 조건


  • OS : MacOS X
  • brew 설치됨
  • Scala : version 2.11.x

  • 1. 설치


    # brewのリポジトリ更新
    $ brew update
    
    # Play Framework インストール
    $ brew install typesafe-activator
    
    # インストール確認
    $ which activator
    /usr/local/bin/activator
    

    2. 프로젝트 생성


    # 新しいアプリケーションを作成
    # 適当なフォルダ<path>で作業を行う。
    $ cd <path>
    $ activator new play-hello-world play-scala
    
    Fetching the latest list of templates...
    
    OK, application "play-hello-world" is being created using the "play-scala" template.
    
    To run "play-hello-world" from the command line, "cd play-hello-world" then:
    /<path>/play-hello-world/activator run
    
    To run the test for "play-hello-world" from the command line, "cd play-hello-world" then:
    /<path>/play-hello-world/activator test
    
    To run the Activator UI for "play-hello-world" from the command line, "cd play-hello-world" then:
    /<path>/play-hello-world/activator ui
    
    

    3. Activator 콘솔에 들어가기


    # 作成されたプロジェクトフォルダに移動
    $ cd play-hello-world/
    # Activator コンソールに入る
    $ activator
    [info] Loading project definition from /<path>/play-hello-world/project
    [info] Set current project to play-hello-world (in build file:/<path>/play-hello-world/)
    [play-hello-world] $
    

    4. 애플리케이션 실행


    # アプリケーションを実行
    [play-hello-world] $ run
    [info] Updating {file:/<path>/play-hello-world/}root...
    [info] Resolving jline#jline;2.12.1 ...
    [info] Done updating.
    
    --- (Running the application, auto-reloading is enabled) ---
    
    [info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
    
    (Server started, use Ctrl+D to stop and go back to the console...)
    

    5. 시작 확인



    프라우자에서 http://localhost:9000/ 방문.
    아래 화면이 표시되면 OK.



    요약



    Scala에서 Play Framework를 사용하는 웹 애플리케이션의 병아리까지 만들었습니다.
    그런 다음 IDE의 IntelliJ IDEA 15 CE를 설치하고 응용 프로그램을 프로젝트로 가져옵니다.

    < Prev Scala 2.11에서 Hello World
    다음> IntelliJ IDEA 15로 PlayFramework 프로젝트를 가져옵니다.

    좋은 웹페이지 즐겨찾기