From 7bd01f555ad4482d28fb5b9edb816dfe469303dd Mon Sep 17 00:00:00 2001 From: Alan Richardson Date: Sat, 16 Mar 2024 14:02:45 +0000 Subject: [PATCH] converted pages to content --- .../challenge/gui/ChallengerWebGUI.java | 8 +- .../src/main/resources/content/learning.md | 41 +++++++ .../src/main/resources/content/sponsors.md | 38 ++++++ .../src/main/resources/public/learning.html | 85 ------------- .../src/main/resources/public/sponsors.html | 112 ------------------ 5 files changed, 86 insertions(+), 198 deletions(-) create mode 100644 challenger/src/main/resources/content/learning.md create mode 100644 challenger/src/main/resources/content/sponsors.md delete mode 100644 challenger/src/main/resources/public/learning.html delete mode 100644 challenger/src/main/resources/public/sponsors.html diff --git a/challenger/src/main/java/uk/co/compendiumdev/challenge/gui/ChallengerWebGUI.java b/challenger/src/main/java/uk/co/compendiumdev/challenge/gui/ChallengerWebGUI.java index cbfa793f..cd1eea8e 100644 --- a/challenger/src/main/java/uk/co/compendiumdev/challenge/gui/ChallengerWebGUI.java +++ b/challenger/src/main/java/uk/co/compendiumdev/challenge/gui/ChallengerWebGUI.java @@ -247,7 +247,13 @@ public void setup(final Challengers challengers, // all html content that is parsed will be in content folder in resources so we don't need to add that in the url String contentFolder = "content"; ClassLoader classLoader = getClass().getClassLoader(); - InputStream inputStream = classLoader.getResourceAsStream(contentFolder + request.pathInfo() + ".md"); + + String contentPath = request.pathInfo(); + if(contentPath.endsWith(".html")){ + contentPath = contentPath.replace(".html", ""); + } + + InputStream inputStream = classLoader.getResourceAsStream(contentFolder + contentPath + ".md"); if(inputStream==null) { pageNotFoundHtmlResponse(response, ""); }else{ diff --git a/challenger/src/main/resources/content/learning.md b/challenger/src/main/resources/content/learning.md new file mode 100644 index 00000000..5e25498a --- /dev/null +++ b/challenger/src/main/resources/content/learning.md @@ -0,0 +1,41 @@ ++++ +title = Learning Utilities and Resources ++++ + +# Learning + +## Mirror Mode + +The Mirror mode is a good way to test out your tooling and see the details of your requests without using a proxy. + +[Access the Mirror Mode Here](/mirror.html) + +## Simulation Mode + +The API has a simulation mode, it uses hard coded data in responses, but tries to mimic some conditions. + +e.g. it expects you to post a specific JSON payload or XML payload and responds 'as if' you sent it. But... it also checks if you sent valid json, or valid xml, and responds based on your headers e.g. returning XML if you ask for it. + +The simulator is stateless and does not track your usage, making it deterministic for multiple users. + +The simulator is a good place to get started because it will respond nicely... unless you mess up the request syntax. + +[Access the Simulator Here](/simulation.html) + +## Automating and Testing a REST API Book + +Alan Richardson wrote a book [Automating and Testing a REST API](https://www.eviltester.com/page/books/automating-testing-api-casestudy/) + +Buying the book helps support this web site and application. + +## Challenge Tutorials + +All of the Challenges have solution tutorials that are available on the [EvilTester.com](https://eviltester.com) blog. + +[Read the API Challenges Posts](https://www.eviltester.com/categories/api-challenges/) + +## Open Source Workshops + +All the material from Alan Richardson's REST API Training workshops have been released to Github. + +[Find the Workshop Material Here](https://www.eviltester.com/post/rest-api-workshops/) \ No newline at end of file diff --git a/challenger/src/main/resources/content/sponsors.md b/challenger/src/main/resources/content/sponsors.md new file mode 100644 index 00000000..cea3e6f3 --- /dev/null +++ b/challenger/src/main/resources/content/sponsors.md @@ -0,0 +1,38 @@ ++++ +title = Sponsors of API Challenges ++++ + +# Support and Sponsorship + +This application is made available free to the public thanks to the generosity of our sponsors and supporters. + +Their support helps: + +- pay for hosting +- support ongoing development +- support creation of associated free training material + +## Current Platinum sponsor + +[![](https://www.eviltester.com/siteimages/evil_laugh_cleaned_transparent_h300.png)](https://eviltester.com) + +- [EvilTester.com](https://eviltester.com) free online training and books related to Software Testing and Development. Also including The Evil Tester Show podcast, and YouTube video channel. + +## Gold Sponsors + +[![Bespoke Software Development Consultancy and Training](https://compendiumdev.co.uk/images/cut_down_logo_152_171_e.png)](https://compendiumdev.co.uk) + +[Want to become a corporate sponsor of API Challenges?](https://eviltester.com/page/sponsor/corporate/) + +## Patreon + +Thank you to everyone who helps supports this project by being a part of our Patreon programme: + +- [Patreon](https://patreon.com/eviltester) + +## Historic Sponsors + +Thank you to all previous sponsors: + +- [EvilTester.com](https://eviltester.com) +- [Compendium Developments](https://compendiumdev.co.uk) diff --git a/challenger/src/main/resources/public/learning.html b/challenger/src/main/resources/public/learning.html deleted file mode 100644 index 98c818b2..00000000 --- a/challenger/src/main/resources/public/learning.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - Learning Utilities and Resources - - - - -
- - - - - -

Learning

-

Mirror Mode

-

The Mirror mode is a good way to test out your tooling and see the details of your requests without using a proxy.

-

Access the Mirror Mode Here

-

Simulation Mode

-

The API has a simulation mode, it uses hard coded data in responses, but tries to mimic some conditions.

-

e.g. it expects you to post a specific JSON payload or XML payload and responds 'as if' you sent it. But... it also checks if you sent valid json, or valid xml, and responds based on your headers e.g. returning XML if you ask for it.

-

The simulator is stateless and does not track your usage, making it deterministic for multiple users.

-

The simulator is a good place to get started because it will respond nicely... unless you mess up the request syntax.

-

Access the Simulator Here

-

Automating and Testing a REST API Book

-

Alan Richardson wrote a book Automating and Testing a REST API

-

Buying the book helps support this web site and application.

-

Challenge Tutorials

-

All of the Challenges have solution tutorials that are available on the EvilTester.com blog.

-

Read the API Challenges Posts

-

Open Source Workshops

-

All the material from Alan Richardson's REST API Training workshops have been released to Github.

-

Find the Workshop Material Here

- - - - -

 


- -
- - diff --git a/challenger/src/main/resources/public/sponsors.html b/challenger/src/main/resources/public/sponsors.html deleted file mode 100644 index 354548dd..00000000 --- a/challenger/src/main/resources/public/sponsors.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - The API Challenges - - - - - - -
- - - - - - - - - - -

Support and Sponsorship

-

This application is made available free to the public thanks to the generosity of our sponsors and supporters.

-

Their support helps:

- -

Current Platinum sponsor

-

- -

Gold Sponsors

-

Bespoke Software Development Consultancy and Training

-

Want to become a corporate sponsor of API Challenges?

-

Patreon

-

Thank you to everyone who helps supports this project by being a part of our Patreon programme:

- -

Historic Sponsors

-

Thank you to all previous sponsors:

- - - - - - - - - - - - - - - - - - -

 


- -
- -