Skip to content

Commit 263aa46

Browse files
save file
1 parent a3a0392 commit 263aa46

1 file changed

Lines changed: 58 additions & 59 deletions

File tree

  • code/nodejs/servers/file-server
Lines changed: 58 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,58 @@
1-
2-
## API
3-
4-
5-
## command line arguments
6-
7-
8-
it supports the following command line arguments
9-
10-
|arg | description | example |
11-
|----------|---------------------------------|----------------|
12-
|-p, -port | specify port | -p 3001 |
13-
| | | |
14-
|-auth | specify authorisation header | -auth p455w0rd |
15-
| | | |
16-
| -d, -dir | specify the source directory | -d /work/tmp |
17-
| | | |
18-
19-
20-
```
21-
22-
node file-server -p 3001 -auth my-password -d /work/tmp
23-
24-
```
25-
26-
27-
the auth parameter is the way of securing the server, it specifies the value of a HTTP header 'auth' that must be included with the request
28-
29-
30-
31-
32-
33-
34-
35-
### mkfile
36-
37-
creates a file on the server
38-
39-
#### parameters
40-
41-
42-
43-
44-
45-
load → retrieve file contents
46-
47-
save → write or overwrite file data
48-
49-
file delete → remove a file
50-
51-
dir read → list directory contents
52-
53-
dir create → make a new directory
54-
55-
dir delete → remove a directory
56-
57-
58-
59-
1+
2+
## API
3+
4+
5+
## command line arguments
6+
7+
8+
it supports the following command line arguments
9+
10+
|arg | description | example |
11+
|----------|---------------------------------|----------------|
12+
|-p, -port | specify port | -p 3001 |
13+
| | | |
14+
|-auth | specify authorisation header | -auth p455w0rd |
15+
| | | |
16+
| -d, -dir | specify the source directory | -d /work/tmp |
17+
| | | |
18+
19+
20+
```
21+
22+
node file-server -p 3001 -auth my-password -d /work/tmp
23+
24+
```
25+
26+
27+
the auth parameter is the way of securing the server, it specifies the value of a HTTP header 'auth' that must be included with the request
28+
29+
30+
31+
32+
33+
34+
35+
### mkfile
36+
37+
creates a file on the server
38+
39+
#### parameters
40+
41+
42+
43+
44+
45+
load → retrieve file contents
46+
47+
save → write or overwrite file data
48+
49+
file delete → remove a file
50+
51+
dir read → list directory contents
52+
53+
dir create → make a new directory
54+
55+
dir delete → remove a directory
56+
57+
58+

0 commit comments

Comments
 (0)