My current challenge involves retrieving JSON data by sending a request to a Restful URL from localhost within an AngularJS-1 application.
The error that I encounter is as follows:
http://localhost:9000/mlm/user/all Failed to load resource:
the server responded with a status of 404 (Not Found)
index.html:1 XMLHttpRequest cannot load http://localhost:9000/mlm/user/all.
Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:63342' is therefore not allowed access.
The response had HTTP status code 404.
In this scenario, I am utilizing play-framework 2.5.4 (java).
Update 1: I have included CORS settings in app.conf
play.filters {
cors {
# Filter paths by a whitelist of path prefixes
pathPrefixes = ["/"]
# The allowed origins. If null, all origins are allowed.
allowedOrigins = null
# The allowed HTTP methods. If null, all methods are allowed
allowedHttpMethods = ["GET", "POST"]
allowedHttpHeaders = ["Accept"]
preflightMaxAge = 3 days
}
}