try gitea actions for dart server
Some checks failed
Build and Push Multi-Arch Docker Image / build-and-push (push) Failing after 1m35s
Some checks failed
Build and Push Multi-Arch Docker Image / build-and-push (push) Failing after 1m35s
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cinema/feature/middlewares/cors.dart';
|
||||
import 'package:cinema/feature/poster/data/repositories/image_loader.dart';
|
||||
import 'package:cinema/feature/poster/data/services/poster.service.dart';
|
||||
import 'package:cinema/feature/root/data/service/root.service.dart';
|
||||
@@ -18,15 +19,12 @@ void main(List<String> args) async {
|
||||
router.mount("/poster", getIt<PosterService>().router.call);
|
||||
router.mount("/", getIt<RootService>().router.call);
|
||||
|
||||
// Configure a pipeline that logs requests.
|
||||
final handler = Pipeline().addMiddleware(logRequests()).addHandler(router.call);
|
||||
|
||||
// Use any available host or container IP (usually `0.0.0.0`).
|
||||
final ip = InternetAddress.anyIPv4;
|
||||
/// add middlewares (Logging, CORS)
|
||||
final handler = Pipeline().addMiddleware(logRequests()).addMiddleware(cors()).addHandler(router.call);
|
||||
|
||||
// For running in containers, we respect the PORT environment variable.
|
||||
final port = int.parse(Platform.environment['PORT'] ?? '3000');
|
||||
await io.serve(handler, ip, port, poweredByHeader: null).then((server) async {
|
||||
await io.serve(handler, InternetAddress.anyIPv4, port, poweredByHeader: null).then((server) async {
|
||||
final bannerFile = File('banner.txt');
|
||||
if (await bannerFile.exists()) {
|
||||
final banner = await bannerFile.readAsString();
|
||||
|
||||
Reference in New Issue
Block a user