Skip to content

Instantly share code, notes, and snippets.

@piyushgarg-dev
Last active May 9, 2021 07:16

Revisions

  1. Piyush Garg revised this gist May 9, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@ const app = express();
    const PORT = 8000;

    app.use(express.static('./public'));
    app.use(express.json());


    app.listen(PORT, () => console.log(`Express server started at PORT:${PORT}`));
  2. Piyush Garg revised this gist May 9, 2021. 1 changed file with 0 additions and 4 deletions.
    4 changes: 0 additions & 4 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -6,9 +6,5 @@ const PORT = 8000;

    app.use(express.static('./public'));

    app.get('/', (request, response) => {
    response.send('Hello from the server');
    });


    app.listen(PORT, () => console.log(`Express server started at PORT:${PORT}`));
  3. Piyush Garg revised this gist May 9, 2021. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,7 @@ const app = express();

    const PORT = 8000;

    ```dif
    + app.use(express.static('./public'));
    ```
    app.use(express.static('./public'));

    app.get('/', (request, response) => {
    response.send('Hello from the server');
  4. Piyush Garg created this gist May 9, 2021.
    16 changes: 16 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    const express = require('express');

    const app = express();

    const PORT = 8000;

    ```dif
    + app.use(express.static('./public'));
    ```

    app.get('/', (request, response) => {
    response.send('Hello from the server');
    });


    app.listen(PORT, () => console.log(`Express server started at PORT:${PORT}`));