/port-scanner-api

A RESTful API for a port scanner.

Primary LanguagePython

port-scanner-api

WIP

Context

Setup

npm install

Deployment

In order to deploy the endpoint simply run:

serverless deploy --profile XXX

Usage

You can create, retrieve, update, or delete scans with the following commands:

Create a scan

curl -X POST https://XXXXXXXXXX.execute-api.us-east-1.amazonaws.com/main/scans -H "x-api-key: XXX" --data "{ ""text"": ""This is a scan."", ""user_id"": ""555"" }"

No output

List all scans

curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/scans

Get one scan

# Replace the <id> part with a real id from your scans table
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/scans/<id>

Update a scan

# Replace the <id> part with a real id from your scans table
curl -X PUT https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/scans/<id> --data "{ ""text"": ""This is a new scan."", ""user_id"": ""555"" }"

Delete a scan

# Replace the <id> part with a real id from your scans table
curl -X DELETE https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/scans/<id>

No output