Skip to content

Commit 90c770b

Browse files
Add files via upload
1 parent 67e4e50 commit 90c770b

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

designer-demo/src/template.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* Copyright (c) 2023 - present TinyEngine Authors.
3+
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
4+
*
5+
* Use of this source code is governed by an MIT-style license.
6+
*
7+
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
8+
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
9+
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
10+
*
11+
*/
12+
import { defineEntry } from '@opentiny/tiny-engine-meta-register'
13+
import engineConfig from '../engine.config'
14+
import 'virtual:svg-icons-register'
15+
16+
async function startApp() {
17+
const { initHook, HOOK_NAME, META_SERVICE, initTemplate } = await import('@opentiny/tiny-engine')
18+
const { HttpService } = await import('./composable')
19+
20+
const beforeAppCreate = () => {
21+
initHook(HOOK_NAME.useEnv, import.meta.env)
22+
}
23+
24+
const registry = {
25+
[META_SERVICE.Http]: HttpService,
26+
'engine.config': {
27+
...engineConfig
28+
}
29+
}
30+
31+
defineEntry(registry)
32+
33+
initTemplate({
34+
registry,
35+
lifeCycles: {
36+
beforeAppCreate
37+
}
38+
})
39+
}
40+
41+
startApp()

0 commit comments

Comments
 (0)