Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit efee30e

Browse files
authored
Docs, actual API Usage example, todo bash example
1 parent a9abcf2 commit efee30e

File tree

3 files changed

+48
-12
lines changed

3 files changed

+48
-12
lines changed

EXAMPLES.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
powershell.ps1
2+
3+
might need a bit of cleanup, but i'll do later.. because learned rust while making this fork in a way...
4+
```
5+
function swscli ($filename)
6+
{
7+
$file = Get-Item $filename;
8+
$fileName = Get-Item $filename
9+
$filetxtname = $($fileName.Name)
10+
11+
$uri = "http://my-simpler-srv.local:8000/"
12+
13+
$currentPath = Convert-Path .
14+
$filePath="$currentPath\$fileName"
15+
16+
$fileBin = Get-Content -Path $fileName.FullName -Raw
17+
$boundary = [System.Guid]::NewGuid().ToString()
18+
$LF = "`r`n"
19+
$bodyLines = (
20+
"--$boundary",
21+
"Content-Disposition: form-data; name=`"files`"; filename=`"$filetxtname`"; csrf=`"notoken`"",
22+
"Content-Type: application/octet-stream$LF",
23+
$fileBin,
24+
"--$boundary--$LF"
25+
) -join $LF
26+
27+
$headers = @{
28+
"Content-Type" = "multipart/form-data; boundary=`"$boundary`""
29+
}
30+
31+
Invoke-RestMethod -Uri $uri -Method POST -Headers $headers -Body $bodyLines
32+
}
33+
34+
function transfersh ($filename)
35+
{
36+
$file = Get-Item $filename;
37+
(Invoke-WebRequest -Method POST -InFile $file.FullName -Uri http://comapredwith.transfer.sh:8000/$($file.Name)).Content
38+
}
39+
40+
# Example usage
41+
swscli(".\my-automatic-output.csv")
42+
```

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
### Command Line Arguments
77
```
8-
Simple HTTP(s) Server 0.6.3
8+
Simpler HTTP(s) Server 0.6.3
99
1010
USAGE:
11-
simple-http-server [FLAGS] [OPTIONS] [--] [root]
11+
simpler-http-server [FLAGS] [OPTIONS] [--] [root]
1212
1313
FLAGS:
1414
--coep Add "Cross-Origin-Embedder-Policy" HTTP header and set it to "require-corp"
@@ -46,7 +46,7 @@ OPTIONS:
4646
# Installation
4747

4848
### Download binary
49-
[Goto Download](https://github.com/TheWaWaR/simple-http-server/releases)
49+
[Goto Download](https://github.com/dw5/simpler-http-server/releases)
5050

5151
- windows-64bit
5252
- osx-64bit
@@ -59,10 +59,10 @@ OPTIONS:
5959
# Install Rust
6060
curl https://sh.rustup.rs -sSf | sh
6161

62-
# Install simple-http-server
63-
cargo install simple-http-server
62+
# Install simpler-http-server
63+
cargo install simpler-http-server
6464
rehash
65-
simple-http-server -h
65+
simpler-http-server -h
6666
```
6767

6868
# Features
@@ -82,7 +82,6 @@ simple-http-server -h
8282
- [Range, If-Range, If-Match] => [Content-Range, 206, 416]
8383
- [x] (default disabled) Automatic render index page [index.html, index.htm]
8484
- [x] (default disabled) Upload file
85-
- A CSRF token is generated when upload is enabled and must be sent as a parameter when uploading a file
8685
- [x] (default disabled) HTTP Basic Authentication (by username:password)
8786
- [x] Sort by: filename, filesize, modified date
8887
- [x] HTTPS support

SECURITY.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)