Contents
A schema
represents the definition of a model. There are two flavors of schemas used in LoopBack: schema for juggler models and OpenAPI schema for route response.
Contents
A schema
represents the definition of a model. There are two flavors of schemas used in LoopBack: schema for juggler models and OpenAPI schema for route response.
import { | |
Count, | |
CountSchema, | |
Filter, | |
FilterBuilder, | |
FilterExcludingWhere, | |
repository, | |
Where, | |
WhereBuilder, | |
} from '@loopback/repository'; |
import {Entity, model, property} from '@loopback/repository'; | |
import moment from 'moment'; | |
@model() | |
export class Customer extends Entity { | |
@property({ | |
type: 'string', | |
id: true, | |
generated: true, | |
}) |
https://github.com/openjs-foundation/cross-project-council/blob/main/NEW_PROJECT_APPLICATION.md
Diana Lau [email protected] GitHub: @dhmlau
LoopBack is a popular Node.js framework for API creation and a platform to build large scale Node.js applications using proven patterns with TypeScript as a first class citizen. It also supports SOAP and enterprise databases.
import {inject, lifeCycleObserver, LifeCycleObserver} from '@loopback/core'; | |
import {juggler} from '@loopback/repository'; | |
const config = { | |
name: 'githubds', | |
connector: 'rest', | |
baseURL: 'https://api.github.ibm.com', | |
crud: false, | |
options: { | |
headers: { |
// Uncomment these imports to begin using these cool features! | |
import {inject} from '@loopback/context'; | |
import {get, param} from '@loopback/openapi-v3'; | |
import {GhQueryService, QueryResponse} from '../services'; | |
// import {inject} from '@loopback/core'; | |
export class GhQueryController { |
export interface GhQueryService { | |
// this is where you define the Node.js methods that will be | |
// mapped to REST/SOAP/gRPC operations as stated in the datasource | |
// json file. | |
// ------------------------------------------------------- | |
// Add the three methods here. | |
// Make sure the function names and the parameter names matches | |
// the ones you defined in the datasource | |
getIssuesByLabel(repo: string, label: string): Promise<QueryResponse>; | |
getIssuesByURL(url: string): Promise<QueryResponse>; |
/** | |
* Get issues from URL | |
* @param nextLinkURL | |
* @param queryService | |
* @param queryResult | |
* @returns | |
*/ | |
async getIssueByURL(nextLinkURL: string, queryService: GhQueryService, queryResult:QueryResult) { | |
let result = await queryService.getIssuesByURL(nextLinkURL); |