Simple cross domen file server over http
How to install?
- get repo
git clone https://github.com/Fulldroper/file-server.git
- get all packages
npm install
How to setup?
change settings inside file settings.json
{
"serverPort":"1337",
"homeDir":"home",
"logsPath":"./",
"hosts":["localhost","my.new.domen.com","192.168.0.1"],
"types":{
".js":"text/javascript",
".txt":"text/plain",
".css":"text/css",
".json":"application/json",
".png":"image/png",
".jpg":"image/jpg",
".ico":"image/x-icon",
".wav":"audio/wav",
".mp4":"video/mp4",
".zip":"application/zip",
".rar":"application/x-rar-compressed",
".iso":"application/octet-stream"
}
}
where:
serverPort
- is a port of serverhomeDir
- is a folder of files where%homeDir%/%domen_name%/index.html
ishttps://%domen_name%/index.html
logsPath
- path of log filelog.txt
hosts
- list of allowed domens and ip`stypes
- list of mime types alowed on server
How to block ip?
Just add ip like a string to file banlist.json
example:
[
"192.168.0.1",
"192.168.0.2"
]
Add domen?
- add name of domen to file
settings.json
insidehosts
- create folder with name as name domen inside folder
%homeDir%
How check logs?
open file
logs.html
or open https://localhost/logs.html