Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup as the readme file states and get CORS issue #228

Open
geniusos-france opened this issue Feb 20, 2024 · 2 comments
Open

Setup as the readme file states and get CORS issue #228

geniusos-france opened this issue Feb 20, 2024 · 2 comments

Comments

@geniusos-france
Copy link

Access to XMLHttpRequest at 'http://localhost/OCM.Web/site/v3/poi/?client=ocm.app.ionic.8.6.1-dev&verbose=false&output=json&includecomments=true&maxresults=500&compact=true&boundingbox=(14.556709228565467,121.03600634182732),(14.567072649698403,121.04612005817103)' from origin 'http://localhost:8101' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.

@geniusos-france
Copy link
Author

I can fix this in the Web Startup.cs configure services by adding this

        services.AddCors();
        services.AddMvc();
        
        
        and in Configure() method:
        
                    app.UseCors(builder => builder
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader());


However, no data is being returned. Ive added admin user and did a refrech all cache

@webprofusion-chrisc
Copy link
Member

Hi, I think you are mixing up the website (openchargemap.org) with the API (api.openchargemap.io) - the ocm-system code includes both and you want to run the OCM.API.Web project

What is your objective?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants