This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ~ curl http://localhost:8080/pages | |
{ | |
"_embedded" : { | |
"pages" : [ { | |
"name" : "login", | |
"_links" : { | |
"self" : { | |
"href" : "http://localhost:8080/pages/1" | |
}, | |
"portal" : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-10-25 22:47:22.337 DEBUG 22802 --- [ost-startStop-1] org.hibernate.SQL : drop table page if exists | |
2014-10-25 22:47:22.337 DEBUG 22802 --- [ost-startStop-1] org.hibernate.SQL : drop table portal if exists | |
2014-10-25 22:47:22.337 DEBUG 22802 --- [ost-startStop-1] org.hibernate.SQL : create table page (id bigint generated by default as identity, name varchar(255), portal_id bigint, primary key (id)) | |
2014-10-25 22:47:22.341 DEBUG 22802 --- [ost-startStop-1] org.hibernate.SQL : create table portal (id bigint generated by default as identity, name varchar(255), primary key (id)) | |
... | |
2014-10-25 22:47:23.292 DEBUG 22802 --- [ main] org.hibernate.SQL : insert into portal (id, name) values (null, ?) | |
2014-10-25 22:47:23.315 DEBUG 22802 --- [ main] org.hibernate.SQL : insert into page (id, name, portal_id) values (null, ?, ?) | |
2014-10-25 22:47:23.318 DEBUG 22802 --- [ main] org.hibernate.SQL : insert into page (id, name, portal_id) values (null, ?, ?) | |
2014-10-25 22:47:23.319 DEBUG 22802 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPRING_PROFILES_ACTIVE=jboss ./standalone.sh -c standalone-backbase.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@Profile("dev") | |
public class StandaloneDataConfig { | |
@Bean | |
public DataSource dataSource() { | |
return new EmbeddedDatabaseBuilder() | |
.setType(EmbeddedDatabaseType.H2) | |
.addScript("classpath:com/bank/config/sql/schema.sql") | |
.addScript("classpath:com/bank/config/sql/test-data.sql") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project ...> | |
<packaging>war</packaging> | |
<properties> | |
<start-class>com.backbase.progfun.Application</start-class> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn spring-boot:run | |
java -jar target/myproject.war | |
deploy the war into a container | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my.servers[0]=dev.bar.com | |
my.servers[1]=foo.bar.com | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
@ConfigurationProperties(locations = "classpath:mail.properties", ignoreUnknownFields = false, prefix = "mail") | |
public class MailProperties { | |
public static class Smtp { | |
private boolean auth; | |
private boolean starttlsEnable; | |
} | |
@NotBlank |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class DatabaseConfig { | |
protected void configureDataSource(org.apache.tomcat.jdbc.pool.DataSource dataSource) { | |
dataSource.setMaxActive(20); | |
dataSource.setMaxIdle(8); | |
dataSource.setMinIdle(8); | |
dataSource.setTestOnBorrow(false); | |
dataSource.setTestOnReturn(false); | |
dataSource.setValidationQuery("SELECT 1"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring.datasource.uri=${DATABASE_URL} | |
spring.data.mongodb.uri=${MONGOLAB_URI} | |
spring.redis.uri=${REDIS_URL} |