mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 10:47:25 +01:00
Add basic http server
This commit is contained in:
parent
a43bd91922
commit
d77f49a21b
17 changed files with 340 additions and 0 deletions
19
server/bin/main.dart
Normal file
19
server/bin/main.dart
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import 'package:aqueduct/aqueduct.dart';
|
||||
import 'package:musicus_server/musicus_server.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
final configFilePath = 'config.yaml';
|
||||
final config = MusicusServerConfiguration(configFilePath);
|
||||
|
||||
final server = Application<MusicusServer>()
|
||||
..options.configurationFilePath = configFilePath
|
||||
..options.address = config.host
|
||||
..options.port = config.port;
|
||||
|
||||
await server.start(
|
||||
consoleLogging: true,
|
||||
);
|
||||
|
||||
print('Database: ${config.dbPath ?? 'memory'}');
|
||||
print('Listening on ${config.host}:${config.port}');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue