Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Make the current folder available on `<yourip>:12345` on the local network:
cute-files --port 12345
```

Make the current folder available on `<yourip>:12345` on the local network and open browser:

```bash
cute-files --port 12345 --launch
```

### Notes

Files starting with a dot are assumed to be private and are not served.
9 changes: 8 additions & 1 deletion cute-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var program = require('commander');
program
.version(pkg.version)
.option('-p, --port <port>', 'Port on which to listen to (defaults to 3000)', parseInt)
.option('-l, --launch', 'Launch default web browser to local server')
.parse(process.argv);

var port = program.port || 3000;
Expand Down Expand Up @@ -59,4 +60,10 @@ app.get('/scan', function(req,res){

app.listen(port);

console.log('Cute files is running on port ' + port);
console.log('Cute files is running on port ' + port);

// opening users browser
var open = require('open');

if(program.launch)
open('http://localhost:' + port);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"dependencies": {
"commander": "^2.3.0",
"content-disposition": "^0.3.0",
"express": "^4.9.4"
"express": "^4.9.4",
"open": "0.0.5"
},
"preferGlobal": true,
"bin": {
Expand Down