A mostly for fun project, demonstrating the use Microsoft Polaris, Azure Pipelines and Docker project to create a simple web api that returns the request with a focus on the ip address for no particular reason.
This project is only meant as a proof of concept and should not be used in production without a thorough review. This includes disclaimer includes any disclaimer given in the Microsoft Polaris project.
The api exposes a few simple endspoints. See below.
-
/
Will return ip address. No other info.
-
/api
Will return complete $request object.
-
/api/:name
Will return specific object within $request object. Dig deeper by doing /api/myobject/deeperobject.
For usage examples, see docker-compose.yml.
- Clone the repository
- Run
docker-compose up -d --build
- The site should now run on http://localhost:5000
The below assumes you've used the docker-compose file to set it up
$uri = <uri>
# This will return your IP address
Invoke-WebRequest -Uri $uri
# This will return everything in the $Request. For more information, either set it up or see the Polaris documentation.
Invoke-WebRequest -Uri "$uri/api"
# You can also get a specific part of the $Request object.
Invoke-WebRequest -Uri "$uri/api/RawRequest"
# Building on the previous example, to dig deeper into an object, you can do:
Invoke-WebRequest -Uri "$uri/api/RawRequest/RawUrl"
- GitHub Issues: Submit a bug / new feature idea / or just a question as a new GitHub issue
- Create basic pester integrationtests.
- Upload to docker hub
- Add .editorconfig & possible .vscode conventions
- Add CICD pipeline
- Set up in an azure functions app
PSIP is licensed under the MIT License.