简体   繁体   中英

Is there any difference between Express and SimpleHTTPServer

Something that I was wondering about between node's express localhost and SimpleHTTPServer from python: was there any differences between the two ways to set up a simple, quick localhost? Benefits?

I know that SimpleHTTPServer is not a full HTTP server. For example, it does not support byteserving http://en.wikipedia.org/wiki/Byte_serving so if you need to serve videos or other streaming files, it will not work.

Express static serving does support byteserving, your own request handlers of course would have to be programmed to support this.

Express is robust NodeJS web application framework, and is akin to something like Python Flask. If you're looking for a simple http server to serve static files for NodeJS, I recommend http-server , which is really awesome and I use it all the time. Install it globally, and you can serve a directory by calling this command from the terminal

http-server ./

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM