-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnippets.curated.json
43 lines (38 loc) · 974 Bytes
/
snippets.curated.json
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
{
"#Requires -Module (Pode)": {
"prefix": "#Requires -Modules @{ ModuleName=\"Pode\"",
"body": [
"#Requires -Modules @{ ModuleName=\"Pode\"; ModuleVersion=\"${1:2.8.0}\" }",
"$0"
]
},
"Add-PodeEndpoint Example": {
"prefix": "Add-PodeEndpoint",
"body": [
"Add-PodeEndpoint -Address ${1:localhost} -Port ${2:80} -Protocol ${3:http}",
"$0"
]
},
"Add-PodeRoute Example": {
"prefix": "Add-PodeRoute",
"body": [
"Add-PodeRoute -Method Get -Path '${1:/}' -ScriptBlock {",
" $2Write-PodeJsonResponse -Value @{ 'value' = 'Hello, world!' }",
"}",
"$0"
]
},
"Start-PodeServer Example": {
"prefix": "Start-PodeServer",
"body": [
"Start-PodeServer {",
" Add-PodeEndpoint -Address ${1:localhost} -Port ${2:80} -Protocol ${3:http}",
"",
" Add-PodeRoute -Method Get -Path '${4:/}' -ScriptBlock {",
" $5Write-PodeJsonResponse -Value @{ 'value' = 'Hello, world!' }",
" }",
"}",
"$0"
]
}
}