move frontend to upper dir.
This commit is contained in:
21
src/services/api-implementation.js
Normal file
21
src/services/api-implementation.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import DjangoApi from './django-api';
|
||||
import Api from './api';
|
||||
|
||||
class ApiImplementation {
|
||||
constructor() {
|
||||
const implementation = process.env.API_IMPLEMENTATION;
|
||||
let apiImplementation;
|
||||
if (implementation === 'django') {
|
||||
apiImplementation = new DjangoApi();
|
||||
} else {
|
||||
throw new Error("API implementation don't configured");
|
||||
}
|
||||
this.api = new Api(apiImplementation);
|
||||
}
|
||||
|
||||
getApi() {
|
||||
return this.api;
|
||||
}
|
||||
}
|
||||
|
||||
export default ApiImplementation;
|
||||
Reference in New Issue
Block a user