Install nvm for managing versions. This allows you to install and switch between different Node versions.
Then install the latest version of Node with:
nvm install stable
In the "reduce page weight" story we changed so that we only load moment locales for countries that we've deployed the OLC to.
We accomplished this with some Webpack trickery and reading the names of the locales in the translations/
folder.
With SOLAS-5735
we've moved the translations to the API, so this folder no longer exists.
We insead get the list of locales from a new translations API endpoint which we created.
So far so good. The issue is that we've hardcoded the translations API URL. This will have to be different depending on if we build for test or for deploying to production.
We haven't deployed the Translations REST API to live yet so let's fake the URL for now.
#encoding: utf-8 | |
require 'cuba' | |
require 'mongoid' | |
require_relative 'mongoidimportexport' | |
require_relative 'modelexample' | |
def send_json(document) | |
res['Content-Type'] = 'application/json; charset=utf-8' | |
res.write ActiveSupport::JSON.encode(document) |