πŸš€ HTTP2 custom server for CRA projects. Boost your App load times!
JavaScript
Switch branches/tags
Nothing to show
Latest commit fef7176 Nov 12, 2017 @JonatanSalas JonatanSalas Update README.md
Permalink
Failed to load latest commit information.
.gitignore Initial commit Nov 12, 2017
.npmignore Initial commit Nov 12, 2017
LICENSE Initial commit Nov 12, 2017
README.md Update README.md Nov 12, 2017
index.js Added address to start log Nov 12, 2017
package-lock.json Initial commit Nov 12, 2017
package.json Initial commit Nov 12, 2017

README.md

cra-http2-push-server

πŸš€ HTTP2 custom server for CRA projects. Boost your App load times!

License: MIT npm version npm downloads

NPM NPM

Installation

YARN

yarn add cra-http2-push-server

NPM

npm install --save cra-http2-push-server

Usage

You have to define the following enviromental values:

#.env

BUILD_DIR=/home/user/project-name/build
ADDRESS=localhost
PORT=8080
ENABLE_HTTPS=true
CERT_DIR=/home/user/project-name/certs
  • BUILD_DIR: Location to the build directory of your create-react-app. It has no default value.
  • ADDRESS: The ip where it will be running, if not passed it will use 'localhost' as default.
  • PORT: The port where it will be exposed, if not passed it will use '8080' as default.
  • ENABLE_HTTPS: true || false. This is necessary for http2 server, to know how it will execute. If 'false' or undefined it will use http for http2.
  • CERT_DIR: If ENABLE_HTTPS is set to 'true', then you have to specify your certificate directory. The server will expect your files to be named like server.crt, server.key, server.csr.

After having this enviromental values defined you then can import the server, and start it:

# index.js

const Http2Server = require('cra-http2-push-server');

Http2Server.start();

Issues

If you found a bug, or you have an answer, or whatever. Please, open an issue. I will do the best to fix it, or help you.

Contributing

Of course, if you see something that you want to upgrade from this library, or a bug that needs to be solved, PRs are welcome!

License

Distributed under the MIT license. See LICENSE for more information.