Skip to content

Instantly share code, notes, and snippets.

@mattiaerre
Last active April 3, 2017 08:52
Show Gist options
  • Select an option

  • Save mattiaerre/32cb87c726c7ecaa79f2a88b04508979 to your computer and use it in GitHub Desktop.

Select an option

Save mattiaerre/32cb87c726c7ecaa79f2a88b04508979 to your computer and use it in GitHub Desktop.

Revisions

  1. mattiaerre revised this gist Dec 11, 2016. No changes.
  2. mattiaerre revised this gist Dec 11, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    /* info: the original "start" from CRA has been renamed to dev and a new "start" that points to server.js has been added */
    {
    // info: the original "start" from CRA has been renamed to dev and a new "start" that points to server.js has been added
    "scripts": {
    "start": "node server.js",
    "dev": "react-scripts start",
  3. mattiaerre created this gist Dec 11, 2016.
    10 changes: 10 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    {
    // info: the original "start" from CRA has been renamed to dev and a new "start" that points to server.js has been added
    "scripts": {
    "start": "node server.js",
    "dev": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
    }
    }
    16 changes: 16 additions & 0 deletions server.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    /*
    * author: Mattia Richetto
    * twitter: @mattiaerre
    * email: [email protected]
    * date: 12/10/2016
    */

    const express = require('express');

    const app = express();

    app.use(express.static('build'));

    const port = process.env.PORT || 3000;

    app.listen(port);