Skip to content

Instantly share code, notes, and snippets.

@addywaddy
Created April 19, 2010 22:46
Show Gist options
  • Save addywaddy/371756 to your computer and use it in GitHub Desktop.
Save addywaddy/371756 to your computer and use it in GitHub Desktop.
fab = require( "fab" );
module.exports = fab
( /^\/(css|scripts|pics)\/.+$/ )
(fab.nodejs.fs, "public/css/master.css")
@jed
Copy link

jed commented Apr 20, 2010

static resources would ideally be served by your web server, but if you'd like to use (fab), it's probably easiest to capture resource type like you're doing now, and use it to compose the local file path

( /^\/static/ )
  ( fab.fs , myFunction )

where myFunction is a unary app that constructs the file path you want based on the incoming path, and sends it back as a string. we'll definitely be building a built-in app that makes this easier, so stay tuned.

@addywaddy
Copy link
Author

cheers for the feedback, jed. fab is a beautiful framework - looking forward to seeing where it goes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment