This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { environmentHelper } from '../../../src/environments/environment'; | |
const environment = environmentHelper(Cypress.env('APP_ENV')); | |
Cypress.Commands.add('pingApiUrl', () => | |
{ | |
cy.request('HEAD', environment.apiUrl); | |
}); | |
Cypress.Commands.add('insertTestData', () => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import environment from '../../../environments/environment'; | |
export default class ExampleService | |
{ | |
read(id) | |
{ | |
const url = new URL(environment.apiRoutes.example + '/' + id, environment.apiUrl); | |
return fetch(url.toString()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = | |
{ | |
metadata: | |
{ | |
branch: 'develop', | |
environment: 'dev' | |
}, | |
baseUrl: 'http://localhost:3000', | |
apiUrl: 'http://localhost:8000', | |
apiRoutes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const environmentHelper = environment => | |
{ | |
if (environment === 'dev') | |
{ | |
return require('./environment.dev'); | |
} | |
if (environment === 'stage') | |
{ | |
return require('./environment.stage'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "perfect-environment", | |
"version": "1.0.0", | |
"dependencies": | |
{ | |
"react": "^17", | |
"react-dom": "^17" | |
}, | |
"devDependencies": | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HttpClient } from '@angular/common/http'; | |
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { Options } from './common.interface'; | |
import { Id } from './common.type'; | |
import { RequestBody, ResponseBody } from './example.interface'; | |
import { environment } from '@env'; | |
@Injectable() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnChanges, OnInit } from '@angular/core'; | |
import { ExampleService } from './example.service'; | |
@Component( | |
{ | |
selector: 'app-example', | |
styleUrls: | |
[ | |
'./example.component.css' | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnChanges, OnInit } from '@angular/core'; | |
import { ExampleService } from './example.service'; | |
@Component( | |
{ | |
selector: 'app-example', | |
styleUrls: | |
[ | |
'./example.component.css' | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { CrudService } from 'ngx-crud'; | |
import { RequestBody, ResponseBody } from './example.interface'; | |
import { environment } from '@env'; | |
@Injectable() | |
export class ExampleService extends CrudService<RequestBody, ResponseBody> | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { CrudService } from 'ngx-crud'; | |
import { RequestBody, ResponseBody } from './example.interface'; | |
import { environment } from '@env'; | |
@Injectable() | |
export class ExampleService extends CrudService<RequestBody, ResponseBody> | |
{ | |
protected apiUrl : string = environment.apiUrl; |
NewerOlder