Serving YUI from express as middleware
Middleware for express that allows you to serve YUI locally from the installed node package.
npm i express express-yui-serve
express-yui-serve package and give it the app and the route to attach to.
In the below example,
app is my express app and
yui3 is my route.
This wil create the following routes on your app:
/yui3/seed /yui3/combo /yui3/*
The seed route is where you point your JS to load a pre-configured YUI seed file.
This route also supports the
Now you need to expose these routes:
var app = require'express'createServerYUIify = require'express-yui-serve';YUIifyapp;//Routes are create for you now..
#!/usr/bin/env nodevar app = require'express'createServerfs = require'fs'YUIify = require'express-yui-serve';YUIifyapp 'yui3';appget'/'ressendfsreadFileSync'./index.html' 'utf8';;applisten8100;