This commit is contained in:
2023-09-14 23:10:30 -06:00
parent a19affcdfd
commit 6aed764160
13 changed files with 695 additions and 22 deletions

View File

@@ -0,0 +1,8 @@
import { Module } from '@nestjs/common';
import { UsersService } from './users.service';
@Module({
providers: [UsersService],
exports: [UsersService]
})
export class UsersModule {}

View File

@@ -0,0 +1,20 @@
import { Injectable } from '@nestjs/common';
require('dotenv').config()
// This should be a real class/interface representing a user entity
export type User = any;
@Injectable()
export class UsersService {
private readonly users = [
{
userId: 1,
username: 'admin',
password: process.env.ADMIN_PASS,
},
];
async findOne(username: string): Promise<User | undefined> {
return this.users.find((user) => user.username === username);
}
}