Giter Site home page Giter Site logo

jameskyburz / serve-create-react-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 1.0 136 KB

serve-create-react-app

Home Page: https://npm.im/serve-create-react-app

License: Apache License 2.0

Shell 21.60% JavaScript 78.40%
server nodejs create-react-app react javascript serve

serve-create-react-app's Introduction

serve-create-react-app

js-standard-style downloads Greenkeeper badge

serve create-react-app using serve as a single page application.

use when you want a backened to your react app.

example

server

process.env.REACT_APP_BUILD=[path to react app build directory]
// base url set by process.env.PUBLIC_URL
const serve = require('serve-create-react-app')('COOKIE_NAME_FOR_BASE_URL')
await serve(req, res)

build

serve-create-react-app [path-to-react]

usage when pathname is not root

Make sure homepage is "." in your react app's package.json.

This is documented here

Then when running set process.env.PUBLIC_URL

usage when pathname is root

Make sure homepage is not added to react app's package.json.

Run without setting process.env.PUBLIC_URL

example Dockerfile

FROM jameskyburz/node:8.0.0-alpine

ENV REACT_APP_BUILD /usr/src/app/src/ui/build

RUN ./node_modules/.bin/serve-create-react-app

USER node

EXPOSE 5000

example Docker run

docker run my-image -e PUBLIC_URL=/foo

license

Apache License, Version 2.0

serve-create-react-app's People

Contributors

greenkeeper[bot] avatar jameskyburz avatar tomtomjohansson avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tomtomjohansson

serve-create-react-app's Issues

map assets from build root

at the moment js is mapped from static which fails with /service-worker.js (issue #1)

Better to map everything from build instead of strict checking of url's

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.