chore: cleaned up hopp-backend package and modified docker and docker-compose files
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
describe('AppController', () => {
|
||||
let appController: AppController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const app: TestingModule = await Test.createTestingModule({
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
}).compile();
|
||||
|
||||
appController = app.get<AppController>(AppController);
|
||||
});
|
||||
|
||||
describe('root', () => {
|
||||
it('should return "Hello World!"', () => {
|
||||
expect(appController.getHello()).toBe('Hello World!');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(private readonly appService: AppService) {}
|
||||
|
||||
@Get()
|
||||
getHello(): string {
|
||||
return this.appService.getHello();
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Query, Resolver } from '@nestjs/graphql';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@Resolver((of) => String)
|
||||
export class AppResolver {
|
||||
constructor(private appService: AppService) {}
|
||||
|
||||
@Query((returns) => String)
|
||||
async author() {
|
||||
return this.appService.getHello();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class AppService {
|
||||
getHello(): string {
|
||||
return 'Hello World!';
|
||||
}
|
||||
}
|
||||
@@ -24,13 +24,6 @@ async function bootstrap() {
|
||||
} else {
|
||||
console.log('Enabling CORS with production settings');
|
||||
|
||||
// HACK: Temporary fix for Liyas to work on production directly :P
|
||||
/*
|
||||
app.enableCors({
|
||||
origin: /hoppscotch\.io$/
|
||||
});
|
||||
*/
|
||||
|
||||
app.enableCors({
|
||||
origin: true,
|
||||
});
|
||||
|
||||
@@ -6,20 +6,10 @@ import { GqlUser } from '../decorators/gql-user.decorator';
|
||||
|
||||
@Resolver(() => User)
|
||||
export class UserResolver {
|
||||
// TODO: remove the eslint-disable line below once dependencies are added to user.service file
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
constructor() {}
|
||||
|
||||
// Query
|
||||
// @Query(() => User, {
|
||||
// nullable: true,
|
||||
// description: 'Finds a user by their UID or null if no match',
|
||||
// deprecationReason:
|
||||
// 'Deprecated due to privacy concerns. Try to get the user from the context-relevant queries',
|
||||
// })
|
||||
// async user(@Args({ name: 'uid', type: () => ID }) uid: string): Promise<User | null> {
|
||||
// return this.userService.getUserForUID(uid);
|
||||
// }
|
||||
|
||||
@Query(() => User, {
|
||||
description:
|
||||
"Gives details of the user executing this query (pass Authorization 'Bearer' header)",
|
||||
@@ -29,29 +19,12 @@ export class UserResolver {
|
||||
return user;
|
||||
}
|
||||
|
||||
// // Mutation
|
||||
// @Mutation(() => Boolean, {
|
||||
// description: 'Delete an user account',
|
||||
// })
|
||||
// @UseGuards(GqlAuthGuard)
|
||||
// deleteUser(
|
||||
// @GqlUser() user:User
|
||||
// ): Promise<boolean> {
|
||||
// return pipe(
|
||||
// this.userService.deleteUserByUID(user),
|
||||
// TE.map(() => true),
|
||||
// TE.mapLeft((message) => message.toString()),
|
||||
// TE.getOrElse(throwErr)
|
||||
// )();
|
||||
// }
|
||||
//
|
||||
// // Subscription
|
||||
// @Subscription(() => User, {
|
||||
// description: 'Listen for user deletion',
|
||||
// resolve: (value) => value,
|
||||
// })
|
||||
// @UseGuards(GqlAuthGuard)
|
||||
// userDeleted(@GqlUser() user: User): AsyncIterator<User> {
|
||||
// return this.pubsub.asyncIterator(`user/${user.uid}/deleted`);
|
||||
// }
|
||||
@Query(() => User, {
|
||||
description:
|
||||
"Gives details of the user executing this query (pass Authorization 'Bearer' header)",
|
||||
})
|
||||
@UseGuards(GqlAuthGuard)
|
||||
me2(@GqlUser() user: User): User {
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ import * as TE from 'fp-ts/TaskEither';
|
||||
import * as T from 'fp-ts/Task';
|
||||
import { User } from './user/user.model';
|
||||
import * as A from 'fp-ts/Array';
|
||||
// import { Reflector } from '@nestjs/core';
|
||||
// import { TeamMemberRole } from './team/team.model';
|
||||
|
||||
/**
|
||||
* A workaround to throw an exception in an expression.
|
||||
|
||||
Reference in New Issue
Block a user