Skip to content

Instantly share code, notes, and snippets.

@kireerik
Created March 3, 2018 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kireerik/dfd0000b9dfe32c8575d7afe4b6ca752 to your computer and use it in GitHub Desktop.
Save kireerik/dfd0000b9dfe32c8575d7afe4b6ca752 to your computer and use it in GitHub Desktop.
Material-UI: Get started (Fast!) ⚡ React 16+
import http from 'http'
import fs from 'fs-extra'
const staticDirectory = process.env.RAZZLE_STATIC_PATH || 'static'
http.get({url: 'http://' + process.env.HOST + ':' + process.env.PORT
, headers: {'User-Agent': 'all'}
}, response =>
response.on('data', html =>
fs.writeFile(staticDirectory + '/' + 'index.html', html)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment