Deploy optimized static Single Page Applications using now
- Static file serving
- Default route is set to
/index.html
- Allows to proxy API requests from
/api
to your endpoint to avoid CORS complications - Optimized cache headers
- Gzip resources
- Customizable by ejecting the configuration
Globally install:
$ npm install -g now-x-static
Deploy current folder:
$ now-x-static
Deploy another folder
$ now-x-static ./build_folder
Deploy with proxy from /api
to api.company.com
$ now-x-static -a `api.company.com`
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)
A Dockerfile
and default.conf
files are copied to your static folder and are removed after the deploy.
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
Eject the Dockerfile
and default.conf
by running
$ now-x-static build_folder -e
Customize the files and use "now" to deploy
$ now --docker build_folder
serve
usesnode
for static file serving with fallback to index.html
No. This is my personal project, built in the spirit of the now eco-system.
Tal Bereznitskey. Find me on Twitter as @ketacode at https://twitter.com/ketacode