TheHumanMachine
TheHumanMachine
WWasp-lang
Created by TheHumanMachine on 4/23/2024 in #đŸ™‹questions
custom http api endpoint
Eh I moved on to fastapi.
13 replies
WWasp-lang
Created by TheHumanMachine on 4/23/2024 in #đŸ™‹questions
custom http api endpoint
I also tried to see if the mage ai generator thing would help. It doesnt understand api or http endpoint. Which is interesting...
13 replies
WWasp-lang
Created by TheHumanMachine on 4/23/2024 in #đŸ™‹questions
custom http api endpoint
It's a typo I don't have discord on my dev laptop. It is foobar. It's literally the same code as in the example with a minor change to the return json
13 replies
WWasp-lang
Created by TheHumanMachine on 4/23/2024 in #đŸ™‹questions
custom http api endpoint
@martinsos I do have another issue though. the code I have added to the open saas main.wasp
api foobar{
fn: import {fooBar} from "@src/server/apis",
httpRoute: {GET, "/foo-bar")
}
api foobar{
fn: import {fooBar} from "@src/server/apis",
httpRoute: {GET, "/foo-bar")
}
apis.ts
import { FooBar } from "wasp/server/api";

export const fooBat : FooBar = (req, res, context) => {
res.set("Access-Control-Allow-Origin", "");
res.json({msg:`Hello`});
};
import { FooBar } from "wasp/server/api";

export const fooBat : FooBar = (req, res, context) => {
res.set("Access-Control-Allow-Origin", "");
res.json({msg:`Hello`});
};
When I go to this endpoint I dont get anything. Everything compiled.
13 replies
WWasp-lang
Created by TheHumanMachine on 4/23/2024 in #đŸ™‹questions
custom http api endpoint
Hey I solved the issue I was having. It seemed all I needed to do was clean the project.
13 replies
WWasp-lang
Created by TheHumanMachine on 4/23/2024 in #đŸ™‹questions
custom http api endpoint
The code provided by the bot is pretty much what I have. The foobar isnt available for import from the 'wasp/server/api'
13 replies