If you need to see the web server on other machines in your local network, you can check what is your IP and use: live-server -host=192.168.1.121Īnd here is a script that automatically grab the IP address of the default interface. If port 8080 is not free, it uses another port: It is fast and has a nice live reload feature, which is very convenient during developpement.īy default it creates a server with IP 127.0.0.1 and port 8080. Use "hg -v help serve" to show global options pid-file name of file to write process ID to webdir-conf name of the webdir config file (serve more than one repo) n -name name to show in web pages (default: working dir) prefix prefix path to serve from (default: server root) a -address address to listen on (default: all interfaces) p -port port to listen on (default: 8000) E -errorlog name of error log file to write to daemon-pipefds used internally by daemon mode A -accesslog name of access log file to write to Use the "-A" and "-E" options to log to files. Start a local HTTP repository browser and pull server.īy default, the server logs accesses to stdout and errors to In the folder you wish to serve up: hg serveįrom the docs: export the repository via HTTP If you use Mercurial, you can use the built in HTTP server. twistd -no web -c cert.pem -k privkey.pem -https=4433 Use this with your existing -path and -port (for plain HTTP) options. Twisted can also utilise security certificates to encrypt the connection. Windows installer available for download at Mac OS-X (comes preinstalled on 10.5 - 10.12, or is available in MacPorts and through Pip) sudo port install py-twisted Ubuntu sudo apt-get install python-twisted-web (or python-twisted for the full engine) There are also a bunch of other commands such as: conch A Conch SSH service. Have a directory full of HTML, cgi, php3, epy, or rpyįiles or any other files that you want to be served up It also accepts command line options (after the "web" command - see twistd web -help for more): -path= is either a specific file or a directory to be "web" is a Command that runs a simple web server on top of the Twisted async engine. o, -no_save do not save state on shutdown Amongst other things you can start up a simple web server in the current directory with: twistd -no web -path=.Įxplanation of Options (see twistd -help for more): -n, -nodaemon don't daemonize, don't use default umask of 0077 It's cross-platform and was preinstalled on OS X 10.5 to 10.12. So to serve the current directory on port 8000, type: http-server -p 8000Īn event-driven networking engine written in Python and licensed under the open source MIT license. -h or -help Displays help message and exits.-s or -silent Silent mode won't log to the console.Now, from any directory, you can type: http-server This will download any required dependencies and install http-server. If you're on Windows you'll need a prompt with administrator permissions, and on Linux/OSX you'll want to sudo the command: npm install http-server -g Then use the node package manager ( npm) to install the package, using the -g option to install globally. This is primarily because it uses asynchronous IO for concurrent handling of requests, instead of serialising requests. Http-server for node.js is very convenient, and is a lot faster than Python's SimpleHTTPServer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |