- 浏览: 2567438 次
- 性别:
- 来自: 成都
-
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Playframework(12)More Samples and Deployment
My first sample is todolist.
Hello World
The second simple example is hello world from the location
>pwd
/opt/play/samples/scala/helloworld
>cd /opt/play/samples/scala/helloworld
>play eclipsify
Import this project to eclipse and study. It is all about controller/action/routers/forms.
But I do not quite understand the test part, extends Specification.
org.specs2.mutable._
Computer Database
A basic CRUD application with JDBC database.
1. Anorm in Scala to visit the database, computer and company
2. list pagination and CRUD forms
3. CSS with twitter bootstrap. http://twitter.github.com/bootstrap/
Forms
Complex forms with validation
Change the router to mapping to different controller.
Change the action path to merge the different html template in different categories.
ZenTasks
Integrate authentication and security
Use AJAX and JavaScript reverse routing.
CometClock
create a Comet connection
write custom Enumerators
WebSocket chat
WebSocket connections
Advanced Akka Usage
MozWebSocket is for firefox.
Comet monitoring
advanced usage of enumerators and enumeratees
After go through all the samples codes. It seems that play is much more like MVC framework. And it has the Oauth, openID, template engine and a lot of other things. And it can also iterate with akka.
Spray is just a punch of tools, spray-IO, spray-CAN, spray-routing. I think it is more like a small and scala version of play.
5 How to deploy play framework application
5.1 Deploying your application(Based on Source Version)
Using the start command
play>start
or
>play start
It is based on standard Netty.
Using the stage task
>play clean compile stage
And everything will be in the place target/staged. And we can start the server with another command
>target/start
But my project does not work, because the Error Message:
Oops, cannot start the server.
PlayException: Database 'default' needs evolution! [An SQL script need to be run on your database.]
Solution:
For command play start, we need add a parameter
>play -DapplyEvolutions.default=true start
For the stage command
>target/start -DapplyEvolutions.default=true
5.2 Creating a standalone version of your application(Based on Binary version)
play>dist
It will create a binary file under /Users/carl/work/play/todolist/dist named todolist-1.0-SNAPSHOT.zip.
If we want to add a configuration file, we need to run like this.
>play -Dconfig.file=/Users/carl/work/play/todolist/conf/application.conf dist
Publishing to a Maven(or Ivy) repository
play>publish
project/Build.scala will be mostly like this, but I did not try.
val main = PlayProject(appName, appVersion, appDependencies).settings(
publishTo :=Some(
"My resolver" at "http://mycompany.com/repo"
)
credentials += Credentials(
"Repo", "http://mycompany.com/repo", "admin", "password"
)
)
5.3. Additional Configuration
Specifying the HTTP server address and port
>start -Dhttp.port=1234 -Dhttp.address=127.0.0.1
Specifying additional JVM arguments
>start -Xms128M -Xmx512m -server
Specifying alternative configuration file
>start -Dconfig.resource=prod.conf
>start -Dconfig.file=/opt/conf/prod.conf
>start -Dconfig.url=http://conf.mycompany.cm/conf/prod.conf
Overriding specific configuration keys
…snip…
Changing the log back configuration file
>start -Dlogger.resource=conf/prod-logger.xml
>start -Dlogger.file=/opt/prod/logger.xml
>start -Dlogger.url=http://conf.mycompany.com/logger.xml
5.5 Set up a front-end HTTP server
Use apache, lighted, nginx, ha-proxy to handle the 80 port, start multiple instances from the back ends.
>start -Dhttp.port=9998
>start -Dhttp.port=9999
References:
http://sillycat.iteye.com/blog/1757098
http://www.playframework.org/documentation/2.0.4/Samples
http://www.playframework.org/documentation/2.0.4/Production
My first sample is todolist.
Hello World
The second simple example is hello world from the location
>pwd
/opt/play/samples/scala/helloworld
>cd /opt/play/samples/scala/helloworld
>play eclipsify
Import this project to eclipse and study. It is all about controller/action/routers/forms.
But I do not quite understand the test part, extends Specification.
org.specs2.mutable._
Computer Database
A basic CRUD application with JDBC database.
1. Anorm in Scala to visit the database, computer and company
2. list pagination and CRUD forms
3. CSS with twitter bootstrap. http://twitter.github.com/bootstrap/
Forms
Complex forms with validation
Change the router to mapping to different controller.
Change the action path to merge the different html template in different categories.
ZenTasks
Integrate authentication and security
Use AJAX and JavaScript reverse routing.
CometClock
create a Comet connection
write custom Enumerators
WebSocket chat
WebSocket connections
Advanced Akka Usage
MozWebSocket is for firefox.
Comet monitoring
advanced usage of enumerators and enumeratees
After go through all the samples codes. It seems that play is much more like MVC framework. And it has the Oauth, openID, template engine and a lot of other things. And it can also iterate with akka.
Spray is just a punch of tools, spray-IO, spray-CAN, spray-routing. I think it is more like a small and scala version of play.
5 How to deploy play framework application
5.1 Deploying your application(Based on Source Version)
Using the start command
play>start
or
>play start
It is based on standard Netty.
Using the stage task
>play clean compile stage
And everything will be in the place target/staged. And we can start the server with another command
>target/start
But my project does not work, because the Error Message:
Oops, cannot start the server.
PlayException: Database 'default' needs evolution! [An SQL script need to be run on your database.]
Solution:
For command play start, we need add a parameter
>play -DapplyEvolutions.default=true start
For the stage command
>target/start -DapplyEvolutions.default=true
5.2 Creating a standalone version of your application(Based on Binary version)
play>dist
It will create a binary file under /Users/carl/work/play/todolist/dist named todolist-1.0-SNAPSHOT.zip.
If we want to add a configuration file, we need to run like this.
>play -Dconfig.file=/Users/carl/work/play/todolist/conf/application.conf dist
Publishing to a Maven(or Ivy) repository
play>publish
project/Build.scala will be mostly like this, but I did not try.
val main = PlayProject(appName, appVersion, appDependencies).settings(
publishTo :=Some(
"My resolver" at "http://mycompany.com/repo"
)
credentials += Credentials(
"Repo", "http://mycompany.com/repo", "admin", "password"
)
)
5.3. Additional Configuration
Specifying the HTTP server address and port
>start -Dhttp.port=1234 -Dhttp.address=127.0.0.1
Specifying additional JVM arguments
>start -Xms128M -Xmx512m -server
Specifying alternative configuration file
>start -Dconfig.resource=prod.conf
>start -Dconfig.file=/opt/conf/prod.conf
>start -Dconfig.url=http://conf.mycompany.cm/conf/prod.conf
Overriding specific configuration keys
…snip…
Changing the log back configuration file
>start -Dlogger.resource=conf/prod-logger.xml
>start -Dlogger.file=/opt/prod/logger.xml
>start -Dlogger.url=http://conf.mycompany.com/logger.xml
5.5 Set up a front-end HTTP server
Use apache, lighted, nginx, ha-proxy to handle the 80 port, start multiple instances from the back ends.
>start -Dhttp.port=9998
>start -Dhttp.port=9999
References:
http://sillycat.iteye.com/blog/1757098
http://www.playframework.org/documentation/2.0.4/Samples
http://www.playframework.org/documentation/2.0.4/Production
发表评论
-
NodeJS12 and Zlib
2020-04-01 07:44 492NodeJS12 and Zlib It works as ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 351Traefik 2020(1)Introduction and ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 449Private Registry 2020(1)No auth ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 401Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 496NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 438Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 346Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 262GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 463GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 336GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 322Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 330Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 306Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 320Serverless with NodeJS and Tenc ... -
NodeJS MySQL Library and npmjs
2020-02-07 06:21 307NodeJS MySQL Library and npmjs ... -
Python Library 2019(1)requests and aiohttp
2019-12-18 01:12 272Python Library 2019(1)requests ... -
NodeJS Installation 2019
2019-10-20 02:57 586NodeJS Installation 2019 Insta ... -
Monitor Tool 2019(2)Monit on Multiple Instances and Email Alerts
2019-10-18 10:57 279Monitor Tool 2019(2)Monit on Mu ... -
Sqlite Database 2019(1)Sqlite3 Installation and Docker phpsqliteadmin
2019-09-05 11:24 388Sqlite Database 2019(1)Sqlite3 ... -
Supervisor 2019(2)Ubuntu and Multiple Services
2019-08-19 10:53 387Supervisor 2019(2)Ubuntu and Mu ...
相关推荐
微软.NET Framework 2.0 SDK Samples 是一套由微软公司发布的开发资源,旨在帮助开发者更好地理解和利用.NET Framework 2.0的强大功能。这套样本集合涵盖了各种编程场景,为开发者提供了丰富的示例代码,涉及语言...
Playframework 1.2.7 是一个开源的Java和Scala Web应用框架,它采用模型-视图-控制器(MVC)架构模式,并且是基于事件驱动的,这使得开发过程更加高效和简洁。这个zip包"play1.2.7.zip"包含了Playframework的SDK,...
在.NET Framework 2.0 SDK Samples中,C#示例将涵盖以下关键领域: 1. **基础语法**:示例会展示C#的基础语法元素,如变量、数据类型、控制流(条件语句、循环)、函数、类和对象等。 2. **面向对象编程**:包括...
In addition to a tools and runtime environment, RDS comes with a large set of samples and tutorials for getting robotics enthusiasts and professionals started writing applications.
Microsoft Deployment Toolkit Samples Guide
"OpenGL samples and glut for VS" 是一个针对Visual Studio(VS)的资源包,旨在帮助开发者在Windows环境下搭建OpenGL开发环境并提供示例代码进行学习。 首先,让我们来了解一下OpenGL。OpenGL是一种跨语言、跨...
这是在OpenGL的一个官方网站上下载的例子,里面有很多基本的和高级的实例。
deploymentmanager-samples, 部署管理器示例和模板 部署管理器示例Google是一个基础设施管理服务,它使得创建。部署和管理云平台资源变得简单。 使用部署管理器,可以创建 static 或者动态模板来描述云云环境的配置...
You can also download the source of these samples into your SDK, then modify and reuse it as you need. For more information, see Getting the Samples. API Demos A variety of small applications that ...
部署管理器示例Google Cloud Deployment Manager是一项基础架构管理服务,可让您轻松创建,部署和管理Google Cloud Platform资源。 使用Deployment Manager,您可以创建描述您的Google Cloud环境配置的静态或动态...
"spring-framework-samples" 是一个官方提供的示例集合,旨在帮助开发者更好地理解和学习Spring Framework的各种功能和用法。 在"spring-framework-samples-master"这个压缩包中,我们通常会发现多个子项目,每个子...
These samples demonstrate many of the new features available with Visual Basic 2008 and the .NET Framework 3.5 including hundreds Language Integrated Query (LINQ) samples. The following is the list ...
AForge.NET Framework-2.2.5-Samples-Docs-Sources.zip 从官网下载的哈,最新,最全。
│ AutonomyV Samples Guide.pdf │ AutonomyV Users Guide.pdf │ AUTOnomyV(vbscript)+samples-users guide.zip │ AUTOnomyV.zip │ └─AUTOnomyV │ AutonomyLib.vbs │ AutonomyV Users Guide.pdf │ ├─...
CUDA Samples是NVIDIA提供的一套示例应用程序,旨在帮助开发者学习和使用CUDA编程模型。CUDA(Compute Unified Device Architecture)是NVIDIA开发的一个并行计算平台和编程模型,允许开发者使用NVIDIA的GPU进行通用...
Android SDK 是开发者学习和实践Android应用开发的重要工具,其中包含了大量的示例代码,也就是我们所说的samples。这些示例代码覆盖了Android开发的各个方面,为初学者提供了丰富的学习材料,同时也为有经验的...
Google Play帐单范例 Google Play结算示例应用程序。 要构建每个样本,请参阅项目目录中的自述文件说明。 在您的Android应用中购买商品。 -在Android应用程序中购买订阅并在服务器上管理订阅。 在您的Android应用...
The samples are released as open source software and uses a Modified BSD licenses. The project was last built and tested using QT 5.9.9, and setting QTDIR to C:\Qt\Qt5.9.9\5.9.9\msvc2017_64 on a ...
MySQL样本安装指南 在深入学习和使用MySQL数据库之前,安装一个功能齐全的示例数据库是十分有益的。本文将引导你完成MySQL样本数据库的安装过程,帮助你快速入门并熟悉数据库管理。 首先,理解MySQL是什么至关重要...
CUDA-Samples是NVIDIA为开发者提供的一个官方样例集合,旨在帮助学习和理解CUDA编程模型,以及如何在实际项目中有效地利用GPU进行计算。这个压缩包“cuda-sample-master”很可能包含了CUDA SDK中的所有示例代码,...