-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
45 lines (30 loc) · 823 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using Flixr;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello World! Welcome to FlixrTest");
app.MapGet(
"/movies/popular",
async ()
=> await VideoController.getPopularMovies()
);
app.MapGet("/movies/{id}", async (string id) =>
{
return await VideoController.getMovieById(id);
});
app.MapGet("/movies", async (HttpContext context) =>
{
return await VideoController.getMovies(context);
});
app.MapGet("/search", async (HttpContext context) =>
{
return await VideoController.searchResult(context);
});
app.MapGet("/series", async (HttpContext context) =>
{
return await VideoController.getSeries(context);
});
app.MapGet("/series/{id}", async (string id) =>
{
return await VideoController.getMovieById(id);
});
app.Run();