-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
48 lines (45 loc) · 962 Bytes
/
main.js
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
47
const LiveDM = new dropMenu({
id:"liveserver"
});
var server = null;
LiveDM.setList({
"button": "LiveServer",
"list":{
"Run":{
click:liveServer
},
"Stop":{
click:()=>{
if(!server ||!server._handle){
new Notification({
title:"Issue",
content:"Server is not started"
})
return
}
new Notification({
title:"Success",
content:"Server has been stopped"
})
server.close();
}
}
}
})
function liveServer(){
const express = require("express")
const app = express()
app.use(express.static(graviton.getCurrentDirectory()));
new Notification({
title:"Success",
content:"Open https://localhost:4500",
buttons:{
"Open":{
click:()=>{
shell.openExternal('http://localhost:4500/')
}
}
}
})
server = app.listen(4500)
}