Skip to content

Commit

Permalink
net.http.file: fix oneline usage examples in the comments of file.ser…
Browse files Browse the repository at this point in the history
…ve/1
  • Loading branch information
spytheman committed Dec 15, 2023
1 parent 1cdd6ed commit 687b33a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vlib/net/http/file/static_server.v
Expand Up @@ -19,11 +19,11 @@ pub mut:
// serve will start a static files web server.
//
// The most common usage is the following:
// v -e 'import net.http; http.serve()'
// v -e 'import net.http.file; file.serve()'
// which will listen for http requests on port 4001 by default, and serve all the files in the current folder.
//
// Another example: `v -e 'import net.http; http.serve(folder: "/tmp")` , same but will serve all files inside the /tmp folder.
// Another example: `v -e 'import net.http; http.serve(folder: "~/Projects", on: ":5002")` , expose all the files inside the ~/Projects folder, on http://localhost:5002/ .
// Another example: `v -e 'import net.http.file; file.serve(folder: "/tmp")` , same but will serve all files inside the /tmp folder.
// Another example: `v -e 'import net.http.file; file.serve(folder: "~/Projects", on: ":5002")` , expose all the files inside the ~/Projects folder, on http://localhost:5002/ .
pub fn serve(params StaticServeParams) {
mut nparams := params
nparams.folder = os.norm_path(os.real_path(params.folder))
Expand Down

0 comments on commit 687b33a

Please sign in to comment.