Created
November 10, 2013 17:50
-
-
Save clarle/7401427 to your computer and use it in GitHub Desktop.
Reproduction for issue #1371
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Hello DataSource!</title> | |
<script src="/yui/yui.js"></script> | |
</head> | |
<body> | |
<p>Hello XML!</p> | |
<script> | |
YUI({ | |
filter: 'raw' | |
}).use('datasource-io', 'datasource-xmlschema', function (Y) { | |
var toolData = new Y.DataSource.IO({ | |
source: './tools' | |
}); | |
toolData.plug({ | |
fn: Y.Plugin.DataSourceXMLSchema, | |
cfg: { | |
schema: { | |
resultListLocator: 'Tool', | |
resultFields: [ | |
{ | |
key: 'assetId', | |
locator: '@assetId' | |
} | |
] | |
} | |
} | |
}); | |
toolData.sendRequest({ | |
request: { | |
foo: 'bar' | |
}, | |
on: { | |
success: function (e) { | |
console.log('success: ' + e.response); | |
}, | |
failure: function (e) { | |
console.log('error: ' + e.error.message); | |
} | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
app = express(); | |
app.use(express.static(__dirname + '/build')); | |
app.get('/', function (req, res) { | |
res.sendfile('index.html'); | |
}); | |
app.get('/tools', function (req, res) { | |
var body = '<Tools></Tools>'; | |
res.setHeader('Content-Type', 'application/xml'); | |
res.end(body); | |
}); | |
app.listen(3000); | |
console.log('App listening on http://localhost:3000'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment