All Questions
Tagged with rest javascript
31
questions
0
votes
0
answers
433
views
Best way to trigger javascript error to go to catch block
I have a couple of doubts regarding the quality of my code. I'm working on a helper function (for KoaJS) where I'm validating a Firebase ID token. If it is valid, I return the decoded token; otherwise ...
0
votes
1
answer
281
views
Sending multiple calls from angular application
I am working in Angular project which is connected to REST API. Here we have an endpoint to create and update room types. POST endpoint for create and PUT endpoint for update exiting room types.
Both ...
2
votes
3
answers
325
views
Good ways to prevent client side logic duplication without HATEOAS?
I know HATEOAS can be a bit of a heated topic. Some people like it, some people don't. That is not what I want to discuss.
What I want to discuss is what technology other than HATEOAS (or some form of ...
0
votes
1
answer
189
views
Best technique for sending multiple files in a single JSON post with Vue/javascript?
Using Vue/Electron to post to rails/Postgres backend.
Is there a common design pattern/approach to posting multiple audio file objects BUT in a single post request?
My current process (which works, ...
0
votes
1
answer
635
views
RPC with Express JS? [closed]
I've been working on a project recently where I have an Expressjs server that supplies weather forecast data to its clients. Right now, I'm using express simply as a means of exposing some functions I ...
2
votes
1
answer
837
views
Best practice for REST result payload when field may have single or multiple values
I Have a REST API endpoint where the caller can supply some optional filters for the results.
GET api/inventory
For example, an object member of a GET request may look like the following
{
"...
3
votes
3
answers
2k
views
REST Api - Check if Action is allowed for entity
I'm asking this question for a colleague since he doesn't have enough reputation to post images in a question
During our normal development we found a deficit in our REST Api.
We display entities in ...
4
votes
2
answers
1k
views
REST Api Design Patterns
I'm developing a REST Api using Node.js & Express.js. Recently I've started looking towards best practices for REST Api design but it's bit confusing so please bear with me.
For Example:
Lets ...
1
vote
1
answer
518
views
The format of an response in ajax — any convention/recommendations?
Say I have a lot of page with ajax. Is there any convention or recommendation on the format/structure of an ajax response? Namely, if there's an error, a server returns http status 4xx or 5xx and... ...
13
votes
4
answers
43k
views
Is it bad design to internally call API endpoints from within the API instance?
For context, I am running a REST API built with Node.js. Because of callbacks and some complex DB calls, I have a chain of functions that are async but also unique, so it's tough to reduce redundancy. ...
1
vote
2
answers
111
views
Avoid wrong variable on branch commit
Our frontend web software contains, inside a file called url.js a variable used as URL root for REST webservices.
var url = "https://devappserver:8080";
During development on developer PC, for ...
3
votes
2
answers
444
views
How do services that rely on client-side access to an API or data consumption endpoint prevent abuse?
For example, web application monitoring services like New Relic RUM or Bucky use JavaScript to collect data on a user's session and eventually send that data back to an endpoint. For New Relic, the ...
0
votes
1
answer
200
views
Should models be returning data directly to the client, or to the controller instead?
Disclaimer: This is my first time: using node, creating a REST API, and trying out MVC server side. (so, just statistically speaking, I'm probably doing something wrong ¯\_(ツ)_/¯)
I'm working on ...
3
votes
2
answers
3k
views
Consuming REST services: client or server
I am working on a new project in which we are currently deciding which technologies and frameworks we will be using. The application will eventually be cross platform. Therefore, for the server side, ...
2
votes
1
answer
184
views
REST Standard for changing SPA Model after fetched from REST API
Let's imagine. I have following data from database.
======================================
id | Title | parentId
======================================
100 Asia NULL
----------...