Serve a Directory with Node.js
As I mentioned in Serve a Directory with Python, sometimes you need a directory to be "served" instead of loading the file://
location within your browser. In the past I would mess around with MAMPStack and swapping out httpdocs
directories, but there are better tools these days.
If you prefer to use Node.js instead of Python, you can use the http-server package:
# Install via shell
npm install http-server -g
# Serve a directory
http-server
# Serve a directory at a specified port
http-server -p 2020
Check out the http-server NPM page to check out specific options, but I wanted to highlight how easy it can be to serve a directory with Node.js. And for JavaScript lovers like me...Node.js is the way to go.
I was inspired when I first saw Addy Osmani's original ShineTime blog post. The hover sheen effect is simple but awesome. When I started my blog redesign, I really wanted to use a sheen effect with my logo. Using two HTML elements and...
The HTML5 revolution has provided us some awesome JavaScript and HTML APIs. Some are APIs we knew we've needed for years, others are cutting edge mobile and desktop helpers. Regardless of API strength or purpose, anything to help us better do our job is a...
One of the reasons I love the Dojo Toolkit is that it seems to have everything. No scouring for a plugin from this site and then another plugin from that site to build my application. Buried within the expansive dojox
namespace of Dojo is
One of the important functions of CSS is to position elements.
Margin
, padding
, top
, left
, right
, bottom
, position
, and z-index
are just a few of the major players in CSS positioning.
By using the above spacing...