Deploy optimized static Single Page Applications using
- Static file serving
- Default route is set to
- Allows to proxy API requests from
/apito your endpoint to avoid CORS complications
- Optimized cache headers
- Gzip resources
- Customizable by ejecting the configuration
$ npm install -g now-x-static
Deploy current folder:
Deploy another folder
$ now-x-static ./build_folder
Deploy with proxy from
$ now-x-static -a `api.company.com`
How it works
Since "now" has support for Docker,
now-x-static configures an
Nginx Dockerfile and deploys it using "now" (You do not need Docker/Nginx installed)
default.conf files are copied to your static folder and are removed after the deploy.
Proxy API calls
In order to avoid CORS,
now-x-static can set a proxy from
/api to an endpoint of your choice:
$ now-x-static -a https://api.company.com
default.conf by running
$ now-x-static build_folder -e
Customize the files and use "now" to deploy
$ now --docker build_folder
nodefor static file serving with fallback to index.html
Is this affiliated or endorsed by zeit.co?
No. This is my personal project, built in the spirit of the now eco-system.
Who made this?
Tal Bereznitskey. Find me on Twitter as @ketacode at https://twitter.com/ketacode