fac10 / week-7-lmao Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://lmao-jokes.herokuapp.com/
Home Page: http://lmao-jokes.herokuapp.com/
I tried to post this, which didn't work:
It's my understanding that the word "algorithm" was coined to recognize Al Gore's contribution to computer science.
Then I took out the apostrophes and speech marks and it posted, not sure why?
Several places will execute the callback twice in the error case. You need a return
or an else
:
https://github.com/FAC10/week-7-LMAO/blob/master/src/handler_home.js#L4
https://github.com/FAC10/week-7-LMAO/blob/master/src/postJoke.js#L5
https://github.com/FAC10/week-7-LMAO/blob/master/src/routes/post_submit.js#L8
If errors occur in handlers, be sure to always respond to the client with something, otherwise the request will hang and the user will get no feedback:
https://github.com/FAC10/week-7-LMAO/blob/master/src/routes/home.js#L9
https://github.com/FAC10/week-7-LMAO/blob/master/src/routes/post_submit.js#L8
tis obsolete appaz
We need routes for
"/" : home > "/login" : login page > "/login/submit" : post page > "/post/submit > "/"
test.hbs is empty
Use it or lose it.
We aren't injecting a payload into the server when we test the 'POST' routes, so the test has no data to work with.
Not sure why but it might be something to do with this:
http://jsgeek.com/posts/deploying-hapi-to-heroku.html
We're not doing anything different to last week but for some reason Heroku "failed to bind to $PORT within 60 seconds of launch". Must be a Hapi thing
Just noticed that if the server can't reach the database all the user sees on the homepage is a JSON error object. Would be nice to catch the error and still render the page, just without any jokes visible. Maybe with a "We can't seem to find any jokes right now" message or something
Create the psql tables for USERS and JOKES.
Include example users.
Includes Jokes.
Create connections.js
Cannot login without the specific login alexis kindly provided
I think you guys must have done this for testing whether submitting a post works
I'm a little confused that you export all your functions in index.js but import them with const routes = require('./routes');
Is there a reason why you don't import the index.js file rather than the whole routes folder?
You're serving everything from the backend using handlebars, so you don't need the HTML file inside public.
I ran npm test
and got the following errors:
sh: 1: tape: not found
sh: 1: tap-spec: not found
Currently it's confusing to read as the joke and author are rendered as <li>
elements. I'm going to quickly change the template so they at least look associated.
Also the header is currently a form? I think it needs to just be links to the /login
and /post
routes.
Templates for
Please could you make sure you are naming your files consistently.
I believe it's not best practice to camelCase your file names.
There is a discussion about this here.
It doesn't work however although thats rich coming from me as we didnt get that far ๐
Not sure if this issue addresses this, but typically you should add the coverage folder to your .gitignore
In your readme it says 'devStart' but it's 'startDev'!
Ideally you should have an empty file called 'config.env.default' that you push to github. That way people can remove 'default' and just add the environment variables.
I tried to write a hilarious joke but your app didn't post anything - I think because it didn't like the punctuation. I had to spell things incorrectly instead ๐ญ
Especially around setting up a database on Travis
https://github.com/FAC10/week-7-LMAO/blob/master/src/postJoke.js#L5
That line will crash, was it meant to be cb(err)
?
Also, you need either a return
or an else
to stop the execution continuing in the error case.
This is a very small (but fun to fix) issue. When I first loaded your app I got error saying that your favicon was not loading (because you don't have one)
I usually create one using this http://www.favicon-generator.org/
Your link to the project on your README goes to https
but the one at the top of your page goes to http
.
I can't access the https one.
Add it to the .gitignore so it doesn't keep coming back
With values from the database
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.