UNPKG

field-guide

Version:

a fully-functional, static site implementation of a design system documentation site

16 lines (12 loc) 436 B
import Route from '@ember/routing/route'; import config from 'ember-get-config'; import { inject as service } from '@ember/service'; export default class ApplicationRoute extends Route { @service fastboot; model() { let host = this.fastboot.isFastBoot ? `${this.fastboot.request.protocol}//${this.fastboot.request.host}` : ''; return fetch(`${host}${config.rootURL}toc.json`).then((res) => res.json()); } }