mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-24 17:44:21 +03:00
Update Waspleau example and blog post to use new Analyzer syntax (#443)
This commit is contained in:
parent
43c14c12c1
commit
f9ff48824b
@ -1,17 +1,20 @@
|
|||||||
app waspleau {
|
app waspleau {
|
||||||
title: "Waspleau"
|
title: "Waspleau",
|
||||||
|
|
||||||
|
server: {
|
||||||
|
setupFn: import serverSetup from "@ext/serverSetup.js"
|
||||||
|
},
|
||||||
|
|
||||||
|
db: { system: PostgreSQL },
|
||||||
|
|
||||||
|
dependencies: [
|
||||||
|
("bull", "4.1.1"),
|
||||||
|
("axios", "^0.21.1")
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
route RootsRoute { path: "/", to: MainPage }
|
||||||
setupFn: import serverSetup from "@ext/serverSetup.js"
|
page MainPage {
|
||||||
}
|
|
||||||
|
|
||||||
db {
|
|
||||||
system: PostgreSQL
|
|
||||||
}
|
|
||||||
|
|
||||||
route "/" -> page Main
|
|
||||||
page Main {
|
|
||||||
component: import Main from "@ext/MainPage.js"
|
component: import Main from "@ext/MainPage.js"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,8 +25,3 @@ query dashboard {
|
|||||||
entity Dummy {=psl
|
entity Dummy {=psl
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
psl=}
|
psl=}
|
||||||
|
|
||||||
dependencies {=json
|
|
||||||
"bull": "4.1.1",
|
|
||||||
"axios": "^0.21.1"
|
|
||||||
json=}
|
|
||||||
|
@ -36,14 +36,13 @@ So, what do we need to get started? First, we need a way to schedule and run job
|
|||||||
|
|
||||||
```css title="main.wasp"
|
```css title="main.wasp"
|
||||||
app waspleau {
|
app waspleau {
|
||||||
title: "Waspleau"
|
title: "Waspleau",
|
||||||
|
|
||||||
|
dependencies: [
|
||||||
|
("bull", "4.1.1"),
|
||||||
|
("axios", "^0.21.1")
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
dependencies {=json
|
|
||||||
"bull": "4.1.1"
|
|
||||||
json=}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
But where do we declare our queue and processing callback functions in Wasp? Uh oh...
|
But where do we declare our queue and processing callback functions in Wasp? Uh oh...
|
||||||
@ -55,10 +54,12 @@ But where do we declare our queue and processing callback functions in Wasp? Uh
|
|||||||
Thankfully, Waspleau can leverage a powerful and flexible [hook supplied by Wasp](https://wasp-lang.dev/docs/language/basic-elements#setupfn) called `server.setupFn`. This declares a JavaScript function that will be executed on server start. Yahoo! This means we can do things like the following:
|
Thankfully, Waspleau can leverage a powerful and flexible [hook supplied by Wasp](https://wasp-lang.dev/docs/language/basic-elements#setupfn) called `server.setupFn`. This declares a JavaScript function that will be executed on server start. Yahoo! This means we can do things like the following:
|
||||||
|
|
||||||
```css title="main.wasp"
|
```css title="main.wasp"
|
||||||
...
|
app waspleau {
|
||||||
|
...
|
||||||
|
|
||||||
server {
|
server: {
|
||||||
setupFn: import serverSetup from "@ext/serverSetup.js"
|
setupFn: import serverSetup from "@ext/serverSetup.js"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user