LoopBack is an open source Node.js framework built on top of Express optimized for mobile, web, and other devices. Connect to multiple data sources, write business logic in Node.js, glue on top of your existing services and data, connect using JS, iOS & Android SDKs.
bajtos on add-node10
Hi people, ho are you ?
how can I select the fields to show on well Model ??
Regards
Hi
I am using loopback 4 for backend and react for front end.
when I make a request on API, it gives me blocked Cors.
I tried this :
let config = {
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json',
},
redirect: 'follow',
referrerPolicy: 'no-referrer',
}
const response = await axios.post(${API}/signUppatient
, obj, config);
but it didn't work
const config = {
name: 'ipfs',
connector: 'rest',
baseURL: 'http://localhost:5001/api/v0/',
crud: false,
operations: [
{
template: {
method: 'POST',
url: 'http://localhost:5001/api/v0/add',
headers: {
'content-type': 'multipart/form-data;'
},
query: {
'only-hash': true,
},
form: {
file: '{file}',
},
},
functions: {
getCID: ['file'],
},
},
{
template: {
method: 'POST',
url: 'http://localhost:5001/api/v0/bootstrap/list',
},
functions: {
getPeers: [],
},
},
],
};
export interface Ipfs {
getCID(file: Buffer): Promise<CID>,
getPeers(): Promise<unknown>
}
allowArray
in an option somewhere. However, I have not found where this option should be inserted. In the model json description I assume, but where?
To help encourage and foster an open community, the GitHub Discussions tab has been enabled. Engage in Q&As, Idea Proposals, or showcase your extensions and projects using LB4.
GitHub Discussions will work alongside Slack to help increase community reach and interaction, and both are actively monitored by the LoopBack 4 Maintainers.
See you there!
GitHub Discussions: https://github.com/strongloop/loopback-next/discussions/7155
Slack: https://loopback.io navbar or strongloop/loopback-next#5048.
Hey Guys, slowly I'm getting frustrated, maybe you can help me out. My problem might be more of a TypeScript problem than a lb4 problem, but maybe you ran into this too.
I built a controller to download a file, like described here: https://loopback.io/doc/en/lb4/File-upload-download.html
Thus I'm injecting the response into my function. Now I'm trying to write a unit test for the controller and am trying to create a stubInstance for the response object which is expected by the function with sinon, but Typescript is not capable of create a stub for an interface. (Type 'SinonStubbedInstance<Response>' is missing the following properties from type 'Response<any, Record<string, any>>': sendStatus, links, send, jsonp, and 77 more.)
Long story short: Any ideas how to unit-test a controller with a injected response object?