Skip to content

Commit

Permalink
[wasm] Use dotnet-serve in Wasm Browser Sample (#45128)
Browse files Browse the repository at this point in the history
* [wasm] Use dotnet serve in wasm browser sample

* [wasm] Remove wasm browser python server

* Check for global dotnet-serve

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
  • Loading branch information
mdh1418 and Mitchell Hwang authored Dec 10, 2020
1 parent ed0f1c1 commit 6ac5dae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 42 deletions.
7 changes: 6 additions & 1 deletion src/mono/netcore/sample/wasm/browser/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ clean:
rm -rf bin

run:
cd bin/$(CONFIG)/publish && python3 server.py
if ! $(DOTNET) tool list --global | grep dotnet-serve; then \
echo "The tool dotnet-serve could not be found. Install with: $(DOTNET) tool install --global dotnet-serve"; \
exit 1; \
else \
$(DOTNET) serve -d bin/$(CONFIG)/publish -p 8000; \
fi
5 changes: 1 addition & 4 deletions src/mono/netcore/sample/wasm/browser/WasmSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,13 @@
<Output TaskParameter="FileWrites" ItemName="FileWrites" />
</WasmAppBuilder>
<Exec Command="chmod a+x $(AppDir)/run-v8.sh" />
<Copy SourceFiles="bin\index.html;bin\server.py" DestinationFolder="$(AppDir)" />
<Copy SourceFiles="bin\index.html" DestinationFolder="$(AppDir)" />
</Target>

<ItemGroup>
<Compile Include="Program.cs" />
<Content Include="index.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="server.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
37 changes: 0 additions & 37 deletions src/mono/netcore/sample/wasm/browser/server.py

This file was deleted.

0 comments on commit 6ac5dae

Please sign in to comment.