I have a java play framework 2.4.x web app providing a JSON/HTTP API. When I run my front-end HTML/JS file:///Users/nize/tmp/index.html calling the API on
filters = "filters.Filters"
play.filters {
cors {
# The allowed origins. If null, all origins are allowed.
allowedOrigins = null
# The allowed HTTP methods. If null, all methods are allowed
allowedHttpMethods = null
# The allowed HTTP headers. If null, all headers are allowed.
allowedHttpHeaders = null
}
}
public class Filters implements HttpFilters {
@Inject
private CORSFilter corsFilter;
public EssentialFilter[] filters() {
return new EssentialFilter[] {
corsFilter.asJava()
};
}
}