Ghar
Ghar
WWasp-lang
Created by Ghar on 8/26/2024 in #đŸ™‹questions
How to create and use a custom template?
How do I create a template and how do I use it once it is created?
6 replies
WWasp-lang
Created by Ghar on 7/31/2024 in #đŸ™‹questions
How to contribute to the SaaS template?
I have 10 micro SaaS applications that I am building. Have a few changes to make to the base SaaS which I think everyone could benefit from. What is the best way for me to provide the SaaS changes?
12 replies
WWasp-lang
Created by Ghar on 7/10/2024 in #đŸ™‹questions
Stripe payment successful does not add credits
In development all is well, in production using stripe tesk key the payment processes successfully but the credits are not added to the account. I have added the webhook in stripe and the CREDITS_PRICE_ID PRO_SUBSCRIPTION_PRICE_ID and STRIPE_WEBHOOK_SECRET to the server and REACT_APP_STRIPE_CUSTOMER_PORTAL to the client.
7 replies
WWasp-lang
Created by Ghar on 7/8/2024 in #đŸ™‹questions
What is the API endpoint in production?
My development environment has port 3000 for the app and 3001 for api. When I deploy to production the site works but the API endpoint does not seem correct. What is the API endpoint in production?
8 replies
WWasp-lang
Created by Ghar on 7/6/2024 in #đŸ™‹questions
Github actions failing with "OpenAI API key not set"
Tests work in development but failing in Github. Checking doc to determine how to safely provide keys.
[WebServer] [app][err] [ Server!] OpenAI API key not set. Please set the OPENAI_API_KEY environment variable.
[WebServer] [app][err] [ Server!] /home/runner/work/mysponsorapp-wasp/mysponsorapp-wasp/app/src/server/actions.ts:76
[WebServer] [app][err] [ Server!] throw new HttpError(500, "OpenAI API key not set. Please set the OPENAI_API_KEY environment variable.");
[WebServer] [app][err] [ Server!] ^
[app][err] [ Server!]
[WebServer] [app][err] [ Server!]
[WebServer] [app][err] [ Server!] HttpError: OpenAI API key not set. Please set the OPENAI_API_KEY environment variable.
[WebServer] [app][err] [ Server!] at <anonymous> (/home/runner/work/mysponsorapp-wasp/mysponsorapp-wasp/app/src/server/actions.ts:76:9)
[WebServer] [app][err] [ Server!] at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
[WebServer] [app][err] [ Server!] at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
[WebServer] [app][err] [ Server!] at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) {
[WebServer] [app][err] [ Server!] statusCode: 500
[WebServer] [app][err] [ Server!] OpenAI API key not set. Please set the OPENAI_API_KEY environment variable.
[WebServer] [app][err] [ Server!] /home/runner/work/mysponsorapp-wasp/mysponsorapp-wasp/app/src/server/actions.ts:76
[WebServer] [app][err] [ Server!] throw new HttpError(500, "OpenAI API key not set. Please set the OPENAI_API_KEY environment variable.");
[WebServer] [app][err] [ Server!] ^
[app][err] [ Server!]
[WebServer] [app][err] [ Server!]
[WebServer] [app][err] [ Server!] HttpError: OpenAI API key not set. Please set the OPENAI_API_KEY environment variable.
[WebServer] [app][err] [ Server!] at <anonymous> (/home/runner/work/mysponsorapp-wasp/mysponsorapp-wasp/app/src/server/actions.ts:76:9)
[WebServer] [app][err] [ Server!] at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
[WebServer] [app][err] [ Server!] at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
[WebServer] [app][err] [ Server!] at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) {
[WebServer] [app][err] [ Server!] statusCode: 500
7 replies
WWasp-lang
Created by Ghar on 7/3/2024 in #đŸ™‹questions
First time wasp user, Unable to add super simple custom API
First time using wasp :) so it is probably user error. I am trying to add a basic API endpoint as follows. In app/main.wasp I have
api helloWorld {
fn: import { helloWorld } from "@src/server/apis.ts",
httpRoute: (GET, "/hello-world")
}
api helloWorld {
fn: import { helloWorld } from "@src/server/apis.ts",
httpRoute: (GET, "/hello-world")
}
in app/src/server/apis.ts I have
import { Request, Response } from 'express';

export const helloWorld = async (_req: Request, res: Response) => {
res.setHeader('Content-Type', 'application/json');
res.status(200).json({ message: "Hello World!" });
};
import { Request, Response } from 'express';

export const helloWorld = async (_req: Request, res: Response) => {
res.setHeader('Content-Type', 'application/json');
res.status(200).json({ message: "Hello World!" });
};
I am expecting a JSON response but instead get HTML curl http://localhost:3000/hello-world returns html not the expected json browsing http://localhost:3000/hello-world returns an html page with layout. Additonal info: Request URL: http://localhost:3000/hello-world Request Method: GET Status Code: 304 Not Modified Remote Address: 127.0.0.1:3000 Referrer Policy: strict-origin-when-cross-origin
7 replies