Skip to content

TechnicallyJoe/psip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psip

MIT licensed Build Status CodeCoverage Version

Docker

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.

Disclaimer

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.

Endpoints

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.

Getting Started

Prerequisites

Usage

For usage examples, see docker-compose.yml.

Development

  1. Clone the repository
  2. Run docker-compose up -d --build
  3. The site should now run on http://localhost:5000

Example

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"

Troubleshooting / Questions

  • GitHub Issues: Submit a bug / new feature idea / or just a question as a new GitHub issue

RoadMap

  • Create basic pester integrationtests.
  • Upload to docker hub
  • Add .editorconfig & possible .vscode conventions
  • Add CICD pipeline
  • Set up in an azure functions app

License

PSIP is licensed under the MIT License.

Maintainer(s)