From 044f1097f97c1a0a1b610b61ac5c4884e7d0a7a0 Mon Sep 17 00:00:00 2001 From: Akilan Date: Fri, 14 Oct 2022 21:14:25 +0400 Subject: [PATCH] added README and removed unwanted files --- README.md | 45 +++++++++++++++++++++- templates/index.html | 88 -------------------------------------------- 2 files changed, 44 insertions(+), 89 deletions(-) delete mode 100644 templates/index.html diff --git a/README.md b/README.md index edc5ebe..5a18f70 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,45 @@ # Web Gateway upload -The following repository consists of the Peernet Web gateway upload implementation. +The following repository consists of the Peernet Web gateway upload implementation. + +## Features: +- Upload file from Webpage +- Upload file to Peernet from a single Curl request + +## Build +```go +go build . +``` + +## Run +Run on default parameters +``` +./WebGatewayUpload +``` +Custom Flags +``` +./WebGatewayUpload -h + +Usage of ./WebGatewayUpload: + -BackEndApiAddress string + current environment (default "localhost:8088") + -Certificate string + SSL Certificate file (default "server.crt") + -Key string + SSL Key file (default "server.key") + -SSL + Flag to check if the SSL certificate is enabled or not + -WebpageAddress string + current environment (default "localhost:8098") +``` + +## Routes +- (GET) `/upload` (Opens upload page in the webgateway) +- (POST) `/upload` (Uploads file to peernet from Webpage) +- (POST) `/uploadCurl` (Uploads file from CURL) + + Ex: + ``` + curl http://localhost:8088/uploadCurl -F add=@test.txt + ``` + + diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index ff66550..0000000 --- a/templates/index.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Peernet Download file - - - - - - - - - - - - -
-
-
-
-
-
-
-

Download this file from Peernet

- Download from the browser -
-
- Download from Peernet Browser -
-
- -
- -
- -
-
-
-
- -
- - - - - - - - - \ No newline at end of file