@@ -18,13 +18,13 @@ dotnet build
1818
1919# Run application
2020dotnet run --project src/Dotnet.Samples.AspNetCore.WebApi
21- # Server starts on http://localhost:5000 (HTTP) and https://localhost:5001 (HTTPS)
21+ # Server starts on https://localhost:9000
2222
2323# View API documentation
24- # Open https://localhost:5001 /swagger in browser
24+ # Open https://localhost:9000 /swagger in browser
2525
2626# View health check
27- curl https://localhost:5001 /health
27+ curl https://localhost:9000 /health
2828```
2929
3030## .NET Version
@@ -249,7 +249,7 @@ dotnet run --project src/Dotnet.Samples.AspNetCore.WebApi
249249
250250## API Endpoints
251251
252- ** Base URL** : ` https://localhost:5001 `
252+ ** Base URL** : ` https://localhost:9000 `
253253
254254| Method | Path | Description |
255255| ------ | ---- | ----------- |
@@ -266,8 +266,8 @@ dotnet run --project src/Dotnet.Samples.AspNetCore.WebApi
266266### Port already in use
267267
268268``` bash
269- # Kill process on port 5000/5001
270- lsof -ti:5000,5001 | xargs kill -9
269+ # Kill process on port 9000
270+ lsof -ti:9000 | xargs kill -9
271271```
272272
273273### Restore/build failures
@@ -297,13 +297,12 @@ rm src/Dotnet.Samples.AspNetCore.WebApi/Storage/players.db
297297### EF Core migration issues
298298
299299``` bash
300- # List migrations
301- dotnet ef migrations list --project src/Dotnet.Samples.AspNetCore.WebApi
300+ # This project uses EnsureCreated() for database initialization
301+ # Schema is automatically created on first run
302302
303- # Apply migrations manually (usually auto-applied on startup)
304- dotnet ef database update --project src/Dotnet.Samples.AspNetCore.WebApi
305-
306- # Note: This project uses EnsureCreated(), not migrations
303+ # To reset the database, delete the SQLite file:
304+ rm src/Dotnet.Samples.AspNetCore.WebApi/Storage/players.db
305+ # Database will be recreated on next startup
307306```
308307
309308### SSL certificate issues (HTTPS)
@@ -313,7 +312,7 @@ dotnet ef database update --project src/Dotnet.Samples.AspNetCore.WebApi
313312dotnet dev-certs https --trust
314313
315314# Or use HTTP instead
316- dotnet run --project src/Dotnet.Samples.AspNetCore.WebApi --urls " http://localhost:5000 "
315+ dotnet run --project src/Dotnet.Samples.AspNetCore.WebApi --urls " http://localhost:9000 "
317316```
318317
319318### Test failures
@@ -339,22 +338,22 @@ docker compose up
339338
340339### Using Swagger UI (Recommended)
341340
342- Open < https://localhost:5001 /swagger > - Interactive documentation with "Try it out"
341+ Open < https://localhost:9000 /swagger > - Interactive documentation with "Try it out"
343342
344343### Using curl
345344
346345``` bash
347346# Health check
348- curl https://localhost:5001 /health -k
347+ curl https://localhost:9000 /health -k
349348
350349# Get all players
351- curl https://localhost:5001 /players -k
350+ curl https://localhost:9000 /players -k
352351
353352# Get player by ID
354- curl https://localhost:5001 /players/1 -k
353+ curl https://localhost:9000 /players/1 -k
355354
356355# Create player
357- curl -X POST https://localhost:5001 /players -k \
356+ curl -X POST https://localhost:9000 /players -k \
358357 -H " Content-Type: application/json" \
359358 -d ' {
360359 "firstName": "Pele",
@@ -366,8 +365,8 @@ curl -X POST https://localhost:5001/players -k \
366365 }'
367366
368367# Update player
369- curl -X PUT https://localhost:5001 /players/1 -k \
370- -H " Content-Type: application/json" \
368+ curl -X PUT https://localhost:9000 /players/1 -k
369+ -H " Content-Type: application/json"
371370 -d ' {
372371 "firstName": "Diego",
373372 "lastName": "Maradona",
@@ -378,7 +377,7 @@ curl -X PUT https://localhost:5001/players/1 -k \
378377 }'
379378
380379# Delete player
381- curl -X DELETE https://localhost:5001 /players/1 -k
380+ curl -X DELETE https://localhost:9000 /players/1 -k
382381```
383382
384383** Note** : ` -k ` flag skips SSL certificate verification for self-signed development certificates.
0 commit comments