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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions