Skip to content

Commit

Permalink
fix/receive-with-specified-port
Browse files Browse the repository at this point in the history
  • Loading branch information
Amin Rostami committed Oct 10, 2022
1 parent 6aec694 commit e74e76e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ var debugLog = (log) => {
if (options.receive) {
const app = createDefaultApp();
let uploadAddress = options.ip? `http://${options.ip}:${options.receivePort}/receive`: `http://${getNetworkAddress()}:${options.receivePort}/receive`;

console.log(uploadAddress);
app.use(fileUpload());

const form = fs.readFileSync(`${__dirname}/receive-form.html`);

app.get('/form', (req, res) => {
app.get('/receive', (req, res) => {
res.send(form.toString());
});

Expand Down Expand Up @@ -199,7 +199,7 @@ var debugLog = (log) => {
stopPort: 1400
}, (err, port) => {
options.receivePort = port;
uploadAddress = options.ip? `http://${options.ip}:${options.receivePort}/form`: `http://${getNetworkAddress()}:${options.receivePort}/form`;
uploadAddress = options.ip? `http://${options.ip}:${options.receivePort}/receive`: `http://${getNetworkAddress()}:${options.receivePort}/receive`;
app.listen(port, listener);
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "easy-sharing",
"version": "1.2.1",
"version": "1.2.2",
"description": "Sharing is a command-line tool to share directories and files from the CLI to iOS and Android devices without the need of an extra client app",
"main": "bin/index.js",
"scripts": {
Expand Down

0 comments on commit e74e76e

Please sign in to comment.