-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
46 lines (41 loc) · 1.32 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { Router } from "@vaadin/router";
export {} from "normalize.css";
export {} from "./css/main.css";
import "@view/HomeView";
import "@view/HelloView";
import "@view/common/NotFound";
import "@view/common/Header";
import "@view/common/Footer";
import "@view/UpdateArraysAndObjectsView";
import "@view/FetchingDataView";
import * as query from 'jquery'
import {Client, Message, StompSubscription} from '@stomp/stompjs';
export const name = "test";
export const router = new Router(document.querySelector("app-main"));
export const parser = new DOMParser();
export const jQuery = query;
export const $ = query;
var client!: Client;
window.addEventListener('load', () => {
initRouter();
});
function initRouter() {
router.setRoutes([
{ path: "/", component: "home-view" },
{ path: "/hello/:name", component: "hello-view" },
{ path: "/update-arrays-and-objects-view", component: "update-arrays-and-objects-view" },
{ path: "/fetching-data-view", component: "fetching-data-view" },
{ path: "(.*)", component: "not-found" }
]);
}
this.client! = new Client({
brokerURL: "'http://localhost/topic",
debug: function (str) {
console.log(str);
},
reconnectDelay: 5000,
heartbeatIncoming: 4000,
heartbeatOutgoing: 4000
});
this.client!.onConnect = function (frame) {
};