I'm writing a JavaScript function that makes an HTTP request and returns a promise for the result (but this question applies equally for a callback-based implementation).  If I know immediately that the arguments supplied for the function are i...
I building a RESTful api and I need to get complex data from front-end. But I am not sure which one should I choose for POST data.  I should get prices for all possible routes of route group. An example: There's a bus, that's starts from port...
Apologies if this is a newbie question . How should I go about structuring my REST API (I use Node & Express).  const mongoose = require('mongoose');  const recipeSchema = mongoose.Schema({     _id: mongoose.Schema.Types.ObjectId,     nam...
This question already has answers here:...
I am working on a Single page application with React, and I have lot of drop downs in the page. These drop downs contains multiple options, and I don't want to hard-code options in java script. Instead i need to get the options from API.   Is the...
I want to auto-update the ID of each customer in the server hosted in localhost:8080 when one or two customers selected randomly gets deleted. Like if there were 5 customers (A,B,C,D,E) with ID (1,2,3,4,5) respectively, and when C and D get deleted,...
I am implementing some functions in JavaScript that take very flexible argument lists.  The signature looks something like this:  function foo([string], [array], [boolean])   It is often the case that the consumer may not have all of the parameters t...
I've created my first Node.js API and now I am at the step where I need to have initial admin when I push the code live.   My app works the way that there is one admin which can send invitations to users and users can register only with that invi...
I'm very new to API and ES6. How will i able to post the username and password and get a response if it is incorrect. BTW, this site is not working.       fetch('http://thisissamplewebsite.com', {     method: 'post',     body: JSO...
I have a very large array of objects (nested objects).  var array = [     { a: "a", b: { .. }, c:"c", ... },     {...} ]   After some API call, I get a brand new array with 1 modified element and I know exactly which element is modifi...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.