i created a custom module under the extensions/ users-permissions/. and there is folder called custom-module. in this folder i created controller folder and route folder. when i test this endpoint http://localhost:1337/api/hello. i got this error. (this is stapi v4 project). how to solve this issue. thank you,
Error::
{
“data”: null,
“error”: {
“status”: 404,
“name”: “NotFoundError”,
“message”: “Not Found”,
“details”: {}
}
}
Files::
custom-controller.js -
‘use strict’;
module.exports = {
async hello(ctx) {
ctx.body = ‘Hello from custom extension!’;
},
};
custom-route.js-
module.exports = {
routes: [
{
method: ‘GET’,
path: ‘/hello’,
handler: ‘custom-controller.hello’,
config: {
auth: false, // Set to false if you want the route to be public
},
},
],
};
and this is the folder stacture.
