

Since a Foxx service is a Node module, the module resolution must be the one that Node uses. If problems arise, just change this to “es5”.
ARANGODB TYPESCRIPT FOXX FULL
The Foxx service javascript files can be in ES2015 although the full support for that specification is being develop (ArangoDB uses the V8 engine). On the “tsconfig.json” file only three entries matter to this project: If the project is only about this database service, all can go to the project’s root folder. Of course, I’m assuming a project where the database service is only a part of the development. This allows to have a compiler running for the db foxx service and other running on the root for the other project files. This project assumes the typescript compiler is ran on the “db” folder. It pertains to your service configuration, so this project does not provide any management for it. The file manifest.json is completely independent of making the service in typescript or javascript. Since the Foxx service is on development mode, the database server will pickup files when they change. The typescript files will be compiled and their output files – in javascript – will be written directly to the Foxx service path on the database folder. On this folder there are two types of files:

I’ve chosen not to put the source files on the root, so one can see the references to the source folder explicitly. The source files for the Foxx service are on the folder “db/src” of the project. Now let’s followup on this project options and particularities. Which you can learn about on the ArangoDB documentation. a Foxx Service is initialized and on development mode.Foxx services are attached to a particular database and allow to build a web-accessible API for your database. This article depicts a startup repository and its structure for programming Foxx services using Typescript 2.0. Although I’ve had to take care of some particularities, hence this article. Searching for programming Node modules in typescript set me in the right direction. Maybe because it is really not that difficult, since the Foxx services are essentially Node modules. The documentation informs that it is possible to use typescript to program the Foxx services and after some searching I’ve found that there is not much information about the subject. Going back from Typescript to Javascript for programming Foxx services for ArangoDB was a nuisance.
