Skip to content

Unsure how to enable Swagger UI / JSON when running from Docker #116

Description

@johnbeech

After reading:

And running GoNorth via docker instructions...

By default, I get no response on the endpoints.

And if I change this code:

            if(env.IsDevelopment())
            {
                app.UseSwagger();

                app.UseSwaggerUI(c =>
                {
                    c.SwaggerEndpoint("/swagger/v1/swagger.json", "GoNorth Api");
                });
            }

to

            if(true)
            {
                app.UseSwagger();

                app.UseSwaggerUI(c =>
                {
                    c.SwaggerEndpoint("/swagger/v1/swagger.json", "GoNorth Api");
                });
            }

(and rebuild docker with docker-compose up --build, I get a HTML page with name, showing this error:

Error
An error occured while processing the request.
Request ID: 00-e6aff5e7c39413fbae94d37ea5ff7a78-2b16cca9e5ce881c-00

And this error on the command line:

gonorth-web-1    | fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
gonorth-web-1    |       An unhandled exception has occurred while executing the request.
gonorth-web-1    |       System.IO.FileNotFoundException: Could not find file '/app/GoNorth.XML'.     
gonorth-web-1    |       File name: '/app/GoNorth.XML'

Would like to build a client to export data from the tool to use with my prototype game system. I thought the Swagger API would be a good place to start.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions