- When I try to use it (to make an example), I get this error:
arangosh> var miAplicacion = require("org/arangodb/foxx").Application;
JavaScript exception in file 'common/bootstrap/modules.js' at 880,54: cannot locate module 'org/arangodb/foxx' for package '/' using module path '/usr/share/arangodb/js/client/modules,/usr/share/arangodb/js/common/modules,/usr/share/arangodb/js/node' and package path '/usr/share/arangodb/js/npm'
! + " and package path '" + this._package._paths + "'";
!
Hello Jan and thank you for you rapid response.
(function() {"use strict";var FoxxApplication = require("org/arangodb/foxx").Application,app = new FoxxApplication();
app.registerRepository("lib",{repository: "repositories/lib"});
app.get('/test', function (req, res) {
res.json(repositories.lib.prueba());
});// Remember to give the applicationContext.app.start(applicationContext);}());
function prueba() {return "hola";}Foxx = require("org/arangodb/foxx");rep = Foxx.Repository.extend({prueba: prueba});
2013-05-22T20:32:16Z [4973] ERROR cannot install route '[object Object]': cannot locate module 'repositories/lib' for package 'application' using module path '/usr/share/arangodb/js/server/modules,/usr/share/arangodb/js/common/modules,/usr/share/arangodb/js/node' and package path '/home/aoramire/Desarrollo/arangodb/test/lib'2013-05-22T20:32:17Z [4973] ERROR cannot install route '[object Object]': cannot locate module 'repositories/lib' for package 'application' using module path '/usr/share/arangodb/js/server/modules,/usr/share/arangodb/js/common/modules,/usr/share/arangodb/js/node' and package path '/home/aoramire/Desarrollo/arangodb/test/lib'
Ok Lucas and thank you for the documents links.
I'm going to read it.