mirror of
https://github.com/bubblecup-12/VogelSocialMedia.git
synced 2025-07-07 16:38:50 +00:00
Update server.ts
This commit is contained in:
parent
85a059889b
commit
4f64a60cb0
1 changed files with 2 additions and 2 deletions
|
@ -10,7 +10,7 @@ const app = express();
|
||||||
const port = 3000;
|
const port = 3000;
|
||||||
type User = {
|
type User = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
username: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ app.get('/', async (req: Request, res: Response) => {
|
||||||
const users = await prisma.user.findMany();
|
const users = await prisma.user.findMany();
|
||||||
|
|
||||||
// Namen extrahieren
|
// Namen extrahieren
|
||||||
const names = users.map((user:User) => user.name);
|
const names = users.map((user:User) => user.username);
|
||||||
|
|
||||||
// Antwort zurück an den Client
|
// Antwort zurück an den Client
|
||||||
res.send(`There are ${users.length} users: ${names.join(', ')}`);
|
res.send(`There are ${users.length} users: ${names.join(', ')}`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue