-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathTestApp.java
More file actions
38 lines (31 loc) · 1.08 KB
/
Copy pathTestApp.java
File metadata and controls
38 lines (31 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package testapp;
import static testapp.TestApp.GLOBAL_CORS.*;
import act.Act;
import act.app.conf.AppConfigurator;
import act.security.CSRFProtector;
/**
* This class runs an ActFramework application with public endpoints to be
* tested
*/
public class TestApp extends AppConfigurator<TestApp> {
public static class GLOBAL_CORS {
public static final String ALLOW_ORIGIN = "google.com";
public static final String ALLOW_EXPOSE_HEADER = "X-Header-One";
public static final String MAX_AGE = "100";
}
@Override
public void configure() {
httpPort(6111);
csrf().disable().protector(CSRFProtector.Predefined.RANDOM);
cors()
.allowOrigin(ALLOW_ORIGIN)
.allowAndExposeHeaders(ALLOW_EXPOSE_HEADER)
.maxAge(Integer.parseInt(MAX_AGE));
}
public static void main(String[] args) throws Exception {
System.setProperty("act.http.port", "6111");
System.setProperty("act.cli.port", "6222");
System.setProperty("act.i18n", "true");
Act.start("ACTEST");
}
}