0 purchases
vschttpd
VSCHTTPD #
Dart server for hosting your local flutter web apps inside the VS Code extension webview iframe
Instalation #
pub global activate vschttpd
copied to clipboard
Run #
inside a flutter app run
vschttpd -p YOURPORT -r build/web
copied to clipboard
Configure #
vschttpd --help
-p, --port Port to listen on.
(defaults to "9001")
-r, --root (mandatory) The path to serve. If not set, the current directory is used.
-a, --address Address to listen on.
(defaults to "localhost")
copied to clipboard
VS Code Extensions #
Inside your extensions web panel use this snippet for bypass cors
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; frame-src ${uri} ${cspSource} http: https:; img-src ${cspSource}; style-src ${uri} ${cspSource}; script-src ${uri} 'nonce-${nonce}';">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="${stylesResetUri}" rel="stylesheet">
<link href="${stylesMainUri}" rel="stylesheet">
</head>
<body>
<iframe id="iframe-content" src="${uri}" frameborder="0" scroll="no"/>
<script type="text/javascript" nonce="${nonce}" src="${scriptUri}"></script>
</body>
</html>
copied to clipboard
where uri should be
http://YOURADDRESS:PORT
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.