wasp/examples/todo-typescript/main.wasp

59 lines
1.7 KiB
JavaScript
Raw Permalink Normal View History

2022-12-20 13:30:00 +03:00
app TodoTypescript {
2022-12-20 13:11:13 +03:00
wasp: {
2024-10-04 14:53:34 +03:00
version: "^0.15.0"
2022-12-20 13:11:13 +03:00
},
title: "ToDo TypeScript",
auth: {
userEntity: User,
methods: {
usernameAndPassword: {}, // this is a very naive implementation, use 'email' in production instead
//google: {}, //https://wasp-lang.dev/docs/integrations/google
//gitHub: {}, //https://wasp-lang.dev/docs/integrations/github
//email: {} //https://wasp-lang.dev/docs/guides/email-auth
2022-12-20 13:11:13 +03:00
},
onAuthFailedRedirectTo: "/login",
}
}
route RootRoute { path: "/", to: MainPage }
page MainPage {
authRequired: true,
component: import { MainPage } from "@src/MainPage.tsx"
2022-12-20 13:11:13 +03:00
}
route LoginRoute { path: "/login", to: LoginPage }
page LoginPage {
component: import { LoginPage } from "@src/LoginPage.tsx"
2022-12-20 13:11:13 +03:00
}
route SignupRoute { path: "/signup", to: SignupPage }
page SignupPage {
component: import { SignupPage } from "@src/SignupPage.tsx"
2022-12-20 13:11:13 +03:00
}
query getTasks {
// We specify the JS implementation of our query (which is an async JS function)
// Even if you use TS and have a queries.ts file, you will still need to import it using the .js extension.
2022-12-20 13:37:22 +03:00
// see here for more info: https://wasp-lang.dev/docs/tutorials/todo-app/03-listing-tasks#wasp-declaration
fn: import { getTasks } from "@src/queries.js",
2022-12-20 13:11:13 +03:00
// We tell Wasp that this query is doing something with the `Task` entity. With that, Wasp will
// automatically refresh the results of this query when tasks change.
entities: [Task]
}
action createTask {
fn: import { createTask } from "@src/actions.js",
2022-12-20 13:11:13 +03:00
entities: [Task]
}
action updateTask {
fn: import { updateTask } from "@src/actions.js",
2022-12-20 13:11:13 +03:00
entities: [Task]
}
action deleteTasks {
fn: import { deleteTasks } from "@src/actions.js",
entities: [Task],
}