Skip to content

Instantly share code, notes, and snippets.

@joakin
Created November 24, 2017 10:19
Show Gist options
  • Save joakin/d2936db75abf6a52c04a89e0a9bdf5dd to your computer and use it in GitHub Desktop.
Save joakin/d2936db75abf6a52c04a89e0a9bdf5dd to your computer and use it in GitHub Desktop.
Static Marvin build
#!/bin/bash
git clone https://github.com/wikimedia/marvin.git
cd marvin/
npm i
npm run build
# Run node server to get the HTML
node dist/server/index.js &
# Save the HTML to dist/
curl http://localhost:3000/ > dist/index.html
# Kill the node server, we don't need it
kill %1
# At this point dist/ has all a standalone static webapp needs, so we can just serve it
npm install -g pushstate-server
pushstate-server dist/
# Open browser, visit http://0.0.0.0:9000 and navigate around
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment