var asteroid = require('asteroid') , app = module.exports = asteroid(); // var StorageService = require('../'); // expose a rest api app.use(asteroid.rest()); app.configure(function () { app.set('port', process.env.PORT || 3000); }); var ds = asteroid.createDataSource({ connector: require('../lib/storage-connector'), provider: 'filesystem', root: '/tmp/storage' }); var Container = ds.createModel('container', {name: String}); console.log(Container); Container.getContainers(console.log); console.log('shared', Container.getContainers.shared); app.model(Container); /* var handler = new StorageService({provider: 'filesystem', root: '/tmp/storage'}); app.service('storage', handler); app.get('/', function (req, res, next) { res.setHeader('Content-Type', 'text/html'); var form = "
" + "Upload to container c1:
" + "
" + ""; res.send(form); res.end(); }); */ app.listen(app.get('port')); console.log('http://127.0.0.1:' + app.get('port'));