cambio en URLs
This commit is contained in:
parent
5fe2dc0bf6
commit
eefa413574
@ -17,7 +17,7 @@ async fn main() {
|
||||
// build our application with a route
|
||||
let app = Router::new()
|
||||
.route("/", get(basic))
|
||||
.route("/u", post(upload))
|
||||
.route("/", post(upload))
|
||||
.route("/f/:hash", get(get_file));
|
||||
|
||||
// run our app with hyper
|
||||
|
@ -8,9 +8,9 @@ SH4R.IN
|
||||
=======
|
||||
|
||||
HTTP POST files here:
|
||||
curl -F'file=@yourfile.png' https://sh4r.in/u
|
||||
curl -F'file=@yourfile.png' https://sh4r.in
|
||||
You can also POST remote URLs:
|
||||
curl -F'url=http://example.com/image.jpg' https://sh4r.in/u
|
||||
curl -F'url=http://example.com/image.jpg' https://sh4r.in
|
||||
|
||||
File URLs are valid for aproximately 5 days.
|
||||
|
||||
@ -34,7 +34,7 @@ and the originating IP address blocked from further uploads.
|
||||
UPLOAD DIRECTLY
|
||||
---------------
|
||||
</pre>
|
||||
<form action=\"http://localhost:3000/u\" method=\"POST\" enctype=\"multipart/form-data\">
|
||||
<form action=\"https://sh4r.in\" method=\"POST\" enctype=\"multipart/form-data\">
|
||||
<input class=\"form-control\" type=\"file\" name=\"file\">
|
||||
<input class=\"form-control\" type=\"submit\" value=\"send\">
|
||||
</form>
|
||||
|
@ -30,7 +30,7 @@ pub async fn upload(mut multipart: Multipart) -> Response {
|
||||
let mut file = File::create(dest).await.expect("error creando arquivo");
|
||||
file.write_all(&data).await.expect("error gardando contido");
|
||||
|
||||
link = format!("http://localhost:3000/f/{}", fillo);
|
||||
link = format!("https://sh4r.in/f/{}", fillo);
|
||||
}
|
||||
|
||||
link.into_response()
|
||||
|
Loading…
Reference in New Issue
Block a user