mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-09-11 15:26:19 +03:00
164 lines
4.2 KiB
JavaScript
164 lines
4.2 KiB
JavaScript
app TodoTypescript {
|
|
wasp: {
|
|
version: "^0.14.0"
|
|
},
|
|
title: "ToDo TypeScript",
|
|
|
|
auth: {
|
|
userEntity: User,
|
|
methods: {
|
|
usernameAndPassword: {
|
|
userSignupFields: import { userSignupFields } from "@src/user/userSignupFields.js"
|
|
},
|
|
// google: {
|
|
// userSignupFields: import { googleUserSignupFields } from "@src/user/userSignupFields.js"
|
|
// },
|
|
// gitHub: {
|
|
// userSignupFields: import { githubUserSignupFields } from "@src/user/userSignupFields.js"
|
|
// },
|
|
// email: {
|
|
// userSignupFields: import { userSignupFields } from "@src/user/userSignupFields.js",
|
|
// fromField: {
|
|
// email: "waspy@app.com"
|
|
// },
|
|
// emailVerification: {
|
|
// clientRoute: EmailVerificationRoute,
|
|
// },
|
|
// passwordReset: {
|
|
// clientRoute: PasswordResetRoute,
|
|
// }
|
|
// } // https://wasp-lang.dev/docs/guides/email-auth
|
|
},
|
|
onAuthFailedRedirectTo: "/login",
|
|
},
|
|
// emailSender: {
|
|
// provider: Dummy
|
|
// },
|
|
db: {
|
|
seeds: [
|
|
import { seedMyDb } from "@src/db/seeds.js"
|
|
],
|
|
},
|
|
webSocket: {
|
|
fn: import { webSocketFn } from "@src/websocket/index",
|
|
autoConnect: true,
|
|
},
|
|
server: {
|
|
setupFn: import { serverSetup } from "@src/setup/serverSetup.js",
|
|
middlewareConfigFn: import { serverMiddlewareFn } from "@src/setup/serverSetup.js"
|
|
},
|
|
client: {
|
|
setupFn: import setup from "@src/setup/clientSetup.js"
|
|
}
|
|
}
|
|
|
|
crud Tasks {
|
|
entity: Task,
|
|
operations: {
|
|
getAll: {
|
|
overrideFn: import { getAllQuery } from "@src/task/crud",
|
|
},
|
|
create: {},
|
|
update: {},
|
|
get: {},
|
|
delete: {}
|
|
}
|
|
}
|
|
|
|
route RootRoute { path: "/", to: MainPage }
|
|
page MainPage {
|
|
authRequired: true,
|
|
// todo(filip): LSP features are broken beucase I haven't yet updated LSP to the new structure.
|
|
component: import { MainPage } from "@src/MainPage.tsx"
|
|
}
|
|
|
|
route LoginRoute { path: "/login", to: LoginPage }
|
|
page LoginPage {
|
|
component: import { LoginPage } from "@src/user/auth.tsx"
|
|
}
|
|
|
|
route SignupRoute { path: "/signup", to: SignupPage }
|
|
page SignupPage {
|
|
component: import { SignupPage } from "@src/user/auth.tsx"
|
|
}
|
|
|
|
// route EmailVerificationRoute { path: "/email-verify", to: EmailVerification }
|
|
// page EmailVerification {
|
|
// component: import { EmailVerificationPage } from "@src/user/auth.tsx"
|
|
// }
|
|
|
|
route ChatRoute { path: "/chat", to: Chat }
|
|
page Chat {
|
|
component: import { ChatPage } from "@src/ChatPage.tsx"
|
|
}
|
|
|
|
// route EmailVerificationRoute { path: "/email-verify", to: EmailVerification }
|
|
// page EmailVerification {
|
|
// component: import { EmailVerificationPage } from "@src/user/auth.tsx"
|
|
// }
|
|
|
|
// route RequestPasswordResetRoute { path: "/request-password-reset", to: RequestPasswordReset }
|
|
// page RequestPasswordReset {
|
|
// component: import { RequestPasswordResetPage } from "@src/user/auth.tsx"
|
|
// }
|
|
|
|
|
|
// route PasswordResetRoute { path: "/password-reset", to: PasswordReset }
|
|
// page PasswordReset {
|
|
// component: import { PasswordResetPage } from "@src/user/auth.tsx"
|
|
// }
|
|
|
|
query getTasks {
|
|
fn: import { getTasks } from "@src/task/queries",
|
|
// 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]
|
|
}
|
|
|
|
query getTotalNumberOfTasks {
|
|
fn: import { getTotalNumberOfTasks } from "@src/task/queries",
|
|
entities: [Task],
|
|
auth: false
|
|
}
|
|
|
|
action createTask {
|
|
fn: import { createTask } from "@src/task/actions",
|
|
entities: [Task]
|
|
}
|
|
|
|
action updateTask {
|
|
fn: import { updateTask } from "@src/task/actions",
|
|
entities: [Task]
|
|
}
|
|
|
|
action deleteTasks {
|
|
fn: import { deleteTasks } from "@src/task/actions",
|
|
entities: [Task],
|
|
}
|
|
|
|
job printTimeAndNumberOfTasks {
|
|
executor: PgBoss,
|
|
perform: {
|
|
fn: import { printTimeAndNumberOfTasks } from "@src/jobs/print"
|
|
},
|
|
entities: [Task],
|
|
schedule: {
|
|
cron: "* * * * *"
|
|
}
|
|
}
|
|
|
|
api fooBar {
|
|
fn: import { fooBar } from "@src/api.js",
|
|
httpRoute: (GET, "/foo/bar")
|
|
}
|
|
|
|
apiNamespace fooBarNamespace {
|
|
middlewareConfigFn: import { fooBarNamespace } from "@src/setup/serverSetup.js",
|
|
path: "/foo/bar"
|
|
}
|
|
|
|
// action customEmailSending {
|
|
// fn: import { send } from "@src/user/customEmailSending",
|
|
// entities: [User]
|
|
// }
|