Wappler v7.2.2 - Stable extensions
Windows 11
When using Prefix
- server action is coming like i/path/api-action.json
instead of /api/path/api-action
Wappler v7.2.2 - Stable extensions
Windows 11
When using Prefix
- server action is coming like i/path/api-action.json
instead of /api/path/api-action
I remember reading on here you should always use underscores not dashes in your action files.
I could be wrong but but does it happen for you with underscores as well?
Actually, the name of a server action is the file name as in api-action.json
. The recommendation for filenames is to use a hyphen which in turn is interpreted as api action
. If an underscore is used in a filename, this will be interpreted as apiaction
.
For this reason, always use an underscore where spaces are prohibited, such as database table_ names, fields and IDs.
I’ve tried using _
as well as -
. But the issue is not related to this symbol.
See:
Prefix
works well. but request URL is wrong.Prefix
when I change/select the API server action again, It changes from /api/security/staff_login_api
to i/security/staff_login_api.json
.Try this: 1st select Dynamic Attributes > Prefix
. Then go-to Server Connect Form properties > Action > Select Server Action
choose the same API or different server action file. The path will come like: i/PATH/API_ACTION.json
which supposed to be like: /api/PATH/API_ACTION
.
@Teodor , is it a bug or am I missing something? Please help
Just reselect the server action after you have set the prefix.
Seems like your previous action was with some full url that we try to strip and it fails, so just reselect it.
And check the value of the url attribute in the code to see exactly what is happening.
After setting prefix when I reselect the action file, it’s coming like this.
It’s happening only in form. Other API actions are working as expected.
Are you selecting server action from the same Wappler project or from different one?
same Wappler project & same file. Even selecting any file from the project is causing same error. Also my Mobile App server address is coming in between http://localhost:59999/
which is not supposed to be here.
Same in the sense: The Mobile Project or API project? I’m selecting from API project which is different from Mobile project.
What kind of project is your current project?
Maybe just empty in code the action attribute before selecting a new one.
Current project is Wappler Mobile Project.
Form submit action is from different API project made in node.js server.
Aha so the server action is coming from a different project.
I will check it out.
For now just empty the action attribute of the form in the code editor and then reselect the form and choose the server action again.
Let me know if it works then.
Nope, It’s the same. Even I tried creating a fresh server action form > select Prefix > choose action file.
The result is same: i/PATH/ACTION_FILE.json