Last active
July 12, 2017 13:08
-
-
Save martyn82/aef27331533556fe9d73dc0fed4a84a7 to your computer and use it in GitHub Desktop.
Simple local Swagger server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Simple Swagger server | |
* 1: Make sure your swagger file is in the same directory as this file; and it is named 'swagger.json' | |
* 2: Run php -S localhost:8001 | |
* | |
* Open your browser to localhost:8001 and see that your swagger file is served. | |
* Now you can use this URL in a local SwaggerUI. | |
*/ | |
header("Access-Control-Allow-Origin: *"); | |
header("Content-Type: application/json"); | |
echo file_get_contents("swagger.json"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment