File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 11<script >
2+ import { assembleUrl } from ' ../util' ;
23 export let uuid;
34
45 function resumeExecution () {
5- fetch (' http://localhost:9009/ unlock' , {
6+ fetch (assembleUrl ( ' / unlock' ) , {
67 headers: {
78 ' pd-id' : uuid
89 }
Original file line number Diff line number Diff line change 11import { writable } from 'svelte/store' ;
2+ import { assembleUrl } from './util' ;
23
34export const messageStore = writable ( [ ] ) ;
45
5- let eventSource ;
6-
7- if ( isProduction ) {
8- eventSource = new EventSource ( '/events' ) ;
9- } else {
10- eventSource = new EventSource ( 'http://localhost:9009/events' ) ;
11- }
6+ let eventSource = new EventSource ( assembleUrl ( '/events' ) ) ;
127
138eventSource . onmessage = function ( message ) {
149 messageStore . update ( m => {
Original file line number Diff line number Diff line change 1+ export function assembleUrl ( path ) {
2+ let url = '' ;
3+
4+ if ( ! isProduction ) {
5+ url = 'http://localhost:9009' ;
6+ }
7+
8+ return url + path ;
9+ }
You can’t perform that action at this time.
0 commit comments