devrim
devrim
WWasp-lang
Created by devrim on 9/13/2024 in #đŸ™‹questions
is there a way to hard restart the app? if i change an api file need to restart manually
if i change a backend or api file wasp wants me to go manually restart, anyway around this requirement? can i set up my own nodemon?
12 replies
WWasp-lang
Created by devrim on 8/30/2024 in #đŸ™‹questions
Implementing a user sign-in to multiple accounts, and placing an account switcher.
did someone do this before?
66 replies
WWasp-lang
Created by devrim on 8/29/2024 in #đŸ™‹questions
my cursor ide broke something, i have no idea how to fix it.
i'm getting this error
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@wasp/core' imported from /Users/d/Projects/videoupdate/videoupdate/app/.wasp/out/server/bundle/server.js
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@wasp/core' imported from /Users/d/Projects/videoupdate/videoupdate/app/.wasp/out/server/bundle/server.js
tried wasp clean/build/start steps but it's not helping..
8 replies
WWasp-lang
Created by devrim on 8/27/2024 in #đŸ™‹questions
want to redirectTo=customURL after login
trying to log a desktop client. desktop client sends /login?authKey=XXX i want to write logic that if authkey is present redirectTo /loginSuccess if not default behaviour. I didn't find a hook for this, wondering if you have any ideas?
6 replies
WWasp-lang
Created by devrim on 8/24/2024 in #đŸ™‹questions
context.user is empty on api endpoint
export const fooBar = (req, res, context) => {
res.set("Access-Control-Allow-Origin", "*"); // Example of modifying headers to override Wasp default CORS middleware.
res.json({ msg: `Hello, ${context.user ? "registered user" : "stranger"}!` });
};
export const fooBar = (req, res, context) => {
res.set("Access-Control-Allow-Origin", "*"); // Example of modifying headers to override Wasp default CORS middleware.
res.json({ msg: `Hello, ${context.user ? "registered user" : "stranger"}!` });
};
this example i'm trying from the tutorial, regardless of auth:true/false has null as context.user, any ideas why?
6 replies
WWasp-lang
Created by devrim on 8/21/2024 in #đŸ™‹questions
Tutorial API implementation doesn't work for me.
my main.wasp is
api upload_video { // APIs and their implementations don't need to (but can) have the same name.
fn: import { fooBar } from "@src/api/api",
httpRoute: (GET, "/api"),
auth: false,
middlewareConfigFn: import { apiMiddleware } from "@src/api/api"
}
api upload_video { // APIs and their implementations don't need to (but can) have the same name.
fn: import { fooBar } from "@src/api/api",
httpRoute: (GET, "/api"),
auth: false,
middlewareConfigFn: import { apiMiddleware } from "@src/api/api"
}
my src/api/api.jsx is
export const fooBar = (req, res, context) => {
console.log("req");
res.set("Access-Control-Allow-Origin", "*"); // Example of modifying headers to override Wasp default CORS middleware.
res.json({ msg: `Hello, ${context.user ? "registered user" : "stranger"}!` });
};

export const apiMiddleware = (config) => {
return config;
};
export const fooBar = (req, res, context) => {
console.log("req");
res.set("Access-Control-Allow-Origin", "*"); // Example of modifying headers to override Wasp default CORS middleware.
res.json({ msg: `Hello, ${context.user ? "registered user" : "stranger"}!` });
};

export const apiMiddleware = (config) => {
return config;
};
code compiles with no problems, but localhost:3000/api endpoint returns 401 instead of the api response. any ideas?
30 replies