-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4eee105
commit 11fa773
Showing
7 changed files
with
115 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
APP_BASE_URL='http://localhost:3000' | ||
APP_BASE_URL='http://localhost:5000' | ||
MONGODB_URI= | ||
SMTP_HOST= | ||
SMTP_POST= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Home</title> | ||
</head> | ||
|
||
<body> | ||
<section class="downloadSection"> | ||
|
||
<div class="upload"> | ||
<form method="post" action="/api/files" enctype="multipart/form-data"> | ||
<label for="myfile">myfile</label> | ||
<input type="file" id="myfile" name="myfile" multiple> | ||
<button>Upload</button> | ||
</form> | ||
</div> | ||
|
||
|
||
|
||
</section> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Home</title> | ||
</head> | ||
|
||
<body> | ||
<section class="downloadSection"> | ||
|
||
<section class="downloadSection"> | ||
|
||
<% if (locals.error) { %> | ||
<h4> | ||
<%= locals.error %> | ||
</h4> | ||
<% } else { %> | ||
<div class="send-download"> | ||
<div class="downloadLink"> | ||
<a href="<%= filePath %>"> | ||
<%= filePath %> | ||
</a> | ||
</div> | ||
<p>OR</p> | ||
<div class="send-email"> | ||
<!-- <form> | ||
<input type="text" value="<%= uuid %>" name="uuid" id="uuid"> | ||
<label for="emailFrom">Sender</label> | ||
<input type="email" name="emailFrom" id="emailFrom"> | ||
<label for="emailTo">Receiver</label> | ||
<input type="email" name="emailTo" id="emailTo"> | ||
<button onclick={handleSubmit} type="submit" id="send-btn">Submit</button> | ||
</form> --> | ||
</div> | ||
</div> | ||
<% } %> | ||
</section> | ||
|
||
</section> | ||
|
||
<script> | ||
const inputSenderEl = document.getElementById('emailFrom') | ||
const inputReceiverEl = document.getElementById('emailTo') | ||
const inputUuidEl = document.getElementById('uuid') | ||
let data = { | ||
uuid: inputUuidEl.value, | ||
emailFrom: inputSenderEl.value, | ||
emailTo: inputReceiverEl.value | ||
} | ||
data = JSON.stringify(data) | ||
const handleSubmit = async () => { | ||
const response = await fetch('http://localhost/api/files/send', { | ||
method:'POST', | ||
headers:{ | ||
'Content-type':"application/json", | ||
}, | ||
body: data | ||
}) | ||
} | ||
console.log(data) | ||
</script> | ||
</body> | ||
|
||
</html> |