Foxx Module Resolution Changes in ArangoDB 2.8

The implementation of the JavaScript require function will be adjusted to improve compatibility with npm modules. The current implementation in 2.7 and earlier versions of ArangoDB strictly adheres to the CommonJS module standard, which deviates from the behaviour implemented in Node and browser bundlers.

Module paths will now be resolved in the following ways: Read more

More info...

ArangoDB 2.7 GA: Significant Improvements

Long awaited and now we´ve finished it! New major release of ArangoDB 2.7 is ready for download. First of all a big thanks to our community for your great support! We´ve implemented a lot of your ideas! After your feedback to RC1 and RC2 we are happy to bring a new major release to the world. With ArangoDB 2.7 we increased our performance even further and improved query handling a lot. Read more

More info...

Foxx Swagger Integration: Streamline API Documentation

The generated API documentation in ArangoDB 2.6 has been updated to Swagger 2. To see the API documentation for any of your Foxx apps, open the web admin frontend and select your app from the Applications tab. For information on how to describe your own APIs in the generated documentation, see the ArangoDB documentation.

But wait, there’s more! In addition to being shown in the web admin frontend, ArangoDB 2.6 allows you to mount your app’s documentation inside the app itself. Using the new controller method apiDocumentation you can define a mount point for the app’s own documentation and apply the same access controls you already use for other routes. Depending on your needs, you can even mount the documentation of other apps in your own Foxx app, use different assets or even your own Swagger API description files. In fact, the new API documentation viewer of the web admin frontend itself is using it.

For more information on the apiDocumentation method, see the documentation. If you want to give the feature a try yourself, check out ArangoDB 3.0 or compile the latest development version from the GitHub repository.

More info...

Foxx Dependencies: Composing More Flexible Foxx Apps

Previously on the ArangoDB blog we saw how we can use the configuration field in manifest.json to make Foxx apps configurable and more re-usable. This is all well and good if we just want to pass in simple values to a Foxx app but sometimes you want to pass in entire Foxx apps. This is where dependencies come in to save the day.

Let’s say you want to use the session storage provided by the ArangoDB sessions app available on the Foxx app store using Foxx exports and imports. Because you hadn’t yet heard of configurations, you simply hard-coded the mount path of your copy of the sessions app in your code: (more…)

More info...

Reusable Foxx Apps with Configurations: ArangoDB Development

While the optional configuration field in Foxx manifests had experimental support all the way back to ArangoDB 2.1, the feature was previously undocumented and not well understood. The upcoming ArangoDB 2.6 release officially introduces Foxx configurations, allowing you to make your existing Foxx apps more re-usable and to make better use of third-party apps.

Let’s say your Foxx app needs an API key to make a request to a third-party service using the request module introduced in ArangoDB 2.5. (more…)

More info...

Testing Foxx with Mocha: ArangoDB Development Insights

Foxx + Mocha

Some of the most frequent questions by new programmers learning Foxx have been about testing. While the HTTP API can easily be tested with any HTTP client and any JavaScript code that can be isolated from the ArangoDB APIs could be tested in similar environments like Node.js or io.js, it was all but impossible to test Foxx apps inside ArangoDB.

The upcoming release of ArangoDB sets out to change this. As of version 2.6, ArangoDB Foxx will come with full support for Mocha tests allowing you to use the same test framework for your frontend code in the browser, your server-side code running on Node.js or io.js, and your backend logic in Foxx. (more…)

More info...

Foxx console – Logging and querying console messages

Aside from the more noticeable features, ArangoDB 2.5 also added the console object to the scope of all Foxx app modules. Unlike the object already available by importing the console module, the Foxx console logs all messages directly to the database.

In addition to allowing you to specify per-application log levels to make sure your debug messages don’t end up cluttering your production database, the API also provides useful extras like optionally logging a full stack trace for every message that is stored as a structured list of objects, making them easy to query using AQL. There’s also a number of convenience methods for querying your application’s log entries from within your Foxx code if you prefer keeping it simple.

console.time('do something');
// ... more code ...
console.time('do more stuff');
// ... even more code ...
console.timeEnd('do more stuff'); // => "do more stuff: 23ms"
// ... a little bit more ....
console.timeEnd('do something'); // => "do something: 52ms"

For more information see the chapter on the Foxx console API in the official ArangoDB documentation.

More info...

Securing your Foxx with API Keys

ArangoDB’s Foxx allows you to easily build an API to access your data sources. But now this API is either public or restricted to users having an account, but those still get unlimited access.

In many use cases you do not want to expose your data in this fashion, but you want to expose it with a more controllable access pattern and want to restrict the requests one user could issue in a certain time period. Popular examples for these API restrictions are Twitter or Facebook. This allows you to offer all of your data but only in limited chunks, and then possibly charge your customers to increase the chunk limit they can request.

All this is done via API keys, which are bound to a user and has become a common pattern to monetize the data you have collected. (more…)

More info...

ArangoDB 2.5 – Improved Foxx Development Process

This version is deprecated. Download the new version of ArangoDB

Version 2.5 of ArangoDB makes the development of Foxx based apps a lot easier.

For each of your Foxx apps you could activate the development mode individually, forcing a reread from disk at every request, and providing additional debug output. Set the development mode for an app doesn’t change the mount-point anymore. The Foxx source location on your filesystem is now identical with the mount-point of your app. (more…)

More info...

New Foxx Debugging Preview: ArangoDB Updates

We are working hard to improve usability and simplify the usage of Foxx which will be shipped with version 2.5. of ArangoDB.

We have learned from the past and collected a lot of feedback, thanks to all people using Foxx already. It helped us to identify the following three important areas of Foxx that should be improved:

  1. Debugging of Foxx apps
  2. Getting started with Foxx
  3. Development Mode
    (more…)
More info...

Get the latest tutorials,
blog posts and news: