Skip to content

Possible problem while running the project locally #2

@duaraghav8

Description

@duaraghav8

I cloned the project and fired up the index.html. The environment loads, but the Data doesn't because the browser's Cross Origin Security Policy blocks it from loading.

So I wrote a simple Node Script which can be used as the entry point of the server instead.
So instead of launching index.html, people can launch the Script and get http://localhost:8080, then everything works flawlessly.
shot

The script (stays in the root directory) is:

server.js

process.chdir (__dirname);

var app = require ('express') (),
    serveStatic = require ('serve-static');

app
    .use (serveStatic (__dirname))
    .listen (process.env.NODE_ENV || 8080, function () {
        console.log ('Ready');
    });

Do you think it will be a good idea to upload the above server.js & Package.json on this repository for the ease of others?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy