2021-11-09 20:52:42 +00:00
|
|
|
import {BootMixin} from '@loopback/boot';
|
|
|
|
import {ApplicationConfig} from '@loopback/core';
|
|
|
|
import {
|
|
|
|
RestExplorerBindings,
|
|
|
|
RestExplorerComponent,
|
|
|
|
} from '@loopback/rest-explorer';
|
|
|
|
import {RepositoryMixin} from '@loopback/repository';
|
|
|
|
import {RestApplication} from '@loopback/rest';
|
|
|
|
import {ServiceMixin} from '@loopback/service-proxy';
|
|
|
|
import path from 'path';
|
|
|
|
import {MySequence} from './sequence';
|
2021-11-16 01:10:35 +00:00
|
|
|
import {AuthenticationComponent} from '@loopback/authentication';
|
|
|
|
import {JWTAuthenticationComponent, UserServiceBindings} from '@loopback/authentication-jwt';
|
2021-11-16 21:28:56 +00:00
|
|
|
import {SzakdolgozatUserService} from './services';
|
2021-11-09 20:52:42 +00:00
|
|
|
|
|
|
|
export {ApplicationConfig};
|
|
|
|
|
|
|
|
export class SzakdolgozatBackendApplication extends BootMixin(
|
|
|
|
ServiceMixin(RepositoryMixin(RestApplication)),
|
|
|
|
) {
|
|
|
|
constructor(options: ApplicationConfig = {}) {
|
|
|
|
super(options);
|
|
|
|
|
|
|
|
// Set up the custom sequence
|
|
|
|
this.sequence(MySequence);
|
|
|
|
|
|
|
|
// Set up default home page
|
|
|
|
this.static('/', path.join(__dirname, '../public'));
|
|
|
|
|
|
|
|
// Customize @loopback/rest-explorer configuration here
|
|
|
|
this.configure(RestExplorerBindings.COMPONENT).to({
|
|
|
|
path: '/explorer',
|
|
|
|
});
|
|
|
|
this.component(RestExplorerComponent);
|
|
|
|
|
2021-11-16 01:10:35 +00:00
|
|
|
// Authentication
|
|
|
|
this.component(AuthenticationComponent);
|
|
|
|
this.component(JWTAuthenticationComponent);
|
2021-11-16 21:28:56 +00:00
|
|
|
this.service(SzakdolgozatUserService, UserServiceBindings.USER_SERVICE);
|
2021-11-16 01:10:35 +00:00
|
|
|
|
2021-11-09 20:52:42 +00:00
|
|
|
this.projectRoot = __dirname;
|
|
|
|
// Customize @loopback/boot Booter Conventions here
|
|
|
|
this.bootOptions = {
|
|
|
|
controllers: {
|
|
|
|
// Customize ControllerBooter Conventions here
|
|
|
|
dirs: ['controllers'],
|
|
|
|
extensions: ['.controller.js'],
|
|
|
|
nested: true,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|