Skip to content

Express server #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Express server #10

wants to merge 2 commits into from

Conversation

sschadwick
Copy link

Creates an Express server to serve a random curse, per conversation in #1.

Running the server

Install Express npm install
Run with npm start
js/main.js will send an AJAX request to /random which will return a randomly chosen curse.

@sschadwick sschadwick mentioned this pull request Oct 13, 2016
Copy link
Owner

@morriswchris morriswchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of this change, though it would break the current functionality of http://morriswchris.github.io/proast/ since GitHub pages does not support backend technologies.

Maybe we can try and setup a heroku app prior merging this in? I can help get that setup

var app = express();
var port = process.env.PORT || 3000;

app.use(express.static(__dirname + '/'));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update this to use the path library? CodeClimate flagged with with Use path.join() or path.resolve() instead of + to create paths.. re: http://eslint.org/docs/rules/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the PR to include path. I'm not able to deploy a Heroku instance of your project, only my fork. I suggest enabling Automatic Deployments so you don't have to juggle multiple remotes.

@sschadwick
Copy link
Author

Finally updated my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants