조용한 담장

간단한 내부 테스트용 HTTP server 본문

tips

간단한 내부 테스트용 HTTP server

iosroid 2020. 8. 11. 13:16

python

https://docs.python.org/3/library/http.server.html

python3 -m http.server 8080 --bind 192.168.0.2

node

https://www.npmjs.com/package/http-server

dart

https://dart.dev/tutorials/server/httpserver

import 'dart:async';
import 'dart:io';
import 'package:http_server/http_server.dart';
import 'package:path/path.dart' as p;

Future main() async {
  final dir = VirtualDirectory('.')
    ..allowDirectoryListing = true;

  final server = await HttpServer.bind(InternetAddress.loopbackIPv4, 8080);
  print('Listening on http://${server.address.address}:${server.port}/');
  await server.forEach(dir.serveRequest);
}

 

Comments