sshirokov / bottlecap Goto Github PK
View Code? Open in Web Editor NEWA tiny static webserver utility built on Bottle
A tiny static webserver utility built on Bottle
Bottlecap is a tiny static HTTP server. I built it on Bottle <http://bottle.paws.de/docs/dev/index.html> Requirements: bottle Required to follow this file directly: virtualenvwrapper pip ############### ### INSTALL ### ############### ## Make a virtualenv to serve as a toggle for bottlecap usage $ mkvirtualenv bottlecap ## Install bottlecap $ pip install https://github.com/sshirokov/bottlecap/tarball/master ############## #### USE ##### ############## ## Activate the bottlecap virtualenv $ workon bottlecap ## Go to where you want to serve data $ cd ~/src/my-project ## Run bottlecap $ bottlecap ## Go to http://localhost:6969 $ open http://localhost:6969 # OS X example ## When you're done with that directory kill bottlecap with Control-C $ bottlecap Bottle server starting [..] Listening on [..] Use Ctrl-C to quit. ^C Shutting down... $ ## When you no longer wish to have bottlecap on your path, deactivate the virtualenv $ deactivate ############## ### NOTES #### ############## ## Like, tips and tricks? => 'bottlecap -h' Will display command-line help => Instead of changing to a directory and running bottlecap you can tell bottlecap where to serve from with the -m PATH/--media=PATH options. => The server will by default reload the content when it notices changes, and dump full stack traces back at the browser when you inevitably run across an awesome bug. => The tutorial above is the absolute quickest point A -> B walkthrough to get you started, system-wide installation is still an option, thogh I usually regard it as one for crazy people. => The index file selection code right now looks for files named roughly 'index.something', prioritizing based on longest match (and as a result, preferring /index.htm.?/) when you hit a url that resolves to a directory. I might add more later, but so might you, the whole project is under 100 lines of codes. That's pretty much it. The code isn't awesome because I hacked it together pretty quick for fun. If there's ever any interest, I'll clean it up and evolve the "idea." Have Fun! -Slava
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.