WaspW
Wasp13mo ago
Jorge

Custom API issue

Trying to implement a custom API, but I'm getting a html as response and the logs are not print in the console.

In main.wasp:

api getChart {
fn: import { getChart } from "@src/server/api/charts",
httpRoute: (GET, "/api/charts"),
//entities: [Chart],
// auth: true
}

In charts.ts:

import { GetChart } from "wasp/server/api";

export const getChart: GetChart = (req, res) => {
console.log("getChart");
console.log("Request params:", req.params);
};
Was this page helpful?