refactor: 💡 allow passthrough in mirage for asciicast data (#108)
This commit is contained in:
1 parent
f878e3404e
commit
ef55d71a55
2 files changed
+4
-18
No files matched your search
@@ -33,6 +33,7 @@ export default function (mirageConfig) {
|
|||||||
function routes() {
|
function routes() {
|
||||||
initializeMockIPC(this, environmentConfig);
|
initializeMockIPC(this, environmentConfig);
|
||||||
|
|
||||||
|
this.passthrough();
|
||||||
// make this `http://localhost:8080`, for example, if your API is on a different server
|
// make this `http://localhost:8080`, for example, if your API is on a different server
|
||||||
// this.urlPrefix = '';
|
// this.urlPrefix = '';
|
||||||
// make this `/api`, for example, if your API is namespaced
|
// make this `/api`, for example, if your API is namespaced
|
||||||
|
|||||||
+3
-18
@@ -2,24 +2,9 @@ import Route from '@ember/routing/route';
|
|||||||
|
|
||||||
export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConnectionChannelRoute extends Route {
|
export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConnectionChannelRoute extends Route {
|
||||||
async model() {
|
async model() {
|
||||||
// building ascii cast here to make player availabe until API is ready
|
const response = await fetch('/session.cast');
|
||||||
const castConfig = {
|
const asciicast = await response.text();
|
||||||
version: 2,
|
|
||||||
width: 124,
|
|
||||||
height: 36,
|
|
||||||
timestamp: 1670352594,
|
|
||||||
env: { SHELL: '/bin/zsh', TERM: 'xterm-256color' },
|
|
||||||
};
|
|
||||||
const asciicast = `${JSON.stringify(castConfig)}
|
|
||||||
[2.676444, "o", "y"]
|
|
||||||
[2.788653, "o", "a"]
|
|
||||||
[2.868652, "o", "r"]
|
|
||||||
[3.001764, "o", "n"]
|
|
||||||
[3.167636, "o", " "]
|
|
||||||
[3.313668, "o", "t"]
|
|
||||||
[3.460527, "o", "e"]
|
|
||||||
[3.561983, "o", "s"]
|
|
||||||
[3.63678, "o", "t"]`;
|
|
||||||
return {
|
return {
|
||||||
scope_id: 'srcc_1234567890',
|
scope_id: 'srcc_1234567890',
|
||||||
asciicast: asciicast,
|
asciicast: asciicast,
|
||||||
|
|||||||
Reference in new issue
Block a user