This file is used to simplify zenStream Server usage
Example1: Files stored in the Working Directory
{
"port":2630,
"root":"/public",
"externalPath":false,
"hostname":"127.0.0.1"
}Explanation:
- port -- used to set portnumber
- root -- the file directory you need to serve from
- externalPath -- this flag sets if Deno should Serve files from it's Current Working Directory or from an external Path
- hostname -- the hostname for the server
Example 2: An External File Path
{
"port":2630,
"root":"/Videos/",
"externalPath":true,
"DRIVE_LETTER":"E",
"hostname":"127.0.0.1"
}Explanation:
- externalPath is set to
truehere, which means Deno will now assume the files are not stored in the Current Working Directory. - root -- the root in this config is set from the very root of the external path, as in the
DRIVE_LETTERdefines the HardDrive (or partition) androotis the address from there. - here
rootis set to be"/Videos/"andDRIVE_LETTERis set to be"E", which means the path from deno will serve the files will be"E:/Videos/"
to run the server simply use,
deno run -A main.ts
Note
the -A flag is used to allow all permissions to the server, from files to network discovery and such. Please refer to Deno documentation to learn more
Tip
Additionally you can use flags like --watch or --watch-hmr to update the runtime to reflect changes without needing manual restart, learn more here