aviris Posted November 5, 2014 Posted November 5, 2014 Download Here This Alfred Workflow will take the active Finder window and serve it up with Harp (http://harpjs.com) web server at localhost:9090. It even opens Safari to http://localhost:9090 for you.** Triggering the workflow while a Harp instance is already serving a Finder directory increment the port number by one (e.g. http://localhost:9091), allowing you to serve several different folders at the same time on your machine. Harp web server automatically preprocesses Jade, Markdown, EJS, CoffeeScript, Sass, LESS and Stylus and serves it as HTML, CSS & JavaScript—no configuration necessary. It even does the vendor prefixing for you. Prerequisites: Harp Web Server - Node (http://nodejs.org) - NPM (included with Node) Once you have installed Node, install Harp with npm install -g harp Harp Quick Start ** This is my use of AppleScript so by the time I got the Terminal window checking and port incrementing working I just put a simple 2 second delay before calling Safari. If Terminal isn't open and Safari is, depending on your machine it may take more than 2 seconds for Harp to initialize. Just hit the reload button in Safari. Or change it to wait a bit longer. Or if you are an AppleScript guru, fix it to wait until Harp is running, then call Safari. Feel free to modify the Applescript for whatever shell commands you may want to issue - I know Harp isn't the only Node based web server around.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now