polyccon / crumbs Goto Github PK
View Code? Open in Web Editor NEWA library for all your favourite biscuits!
Home Page: http://crumbs-fac.herokuapp.com/
A library for all your favourite biscuits!
Home Page: http://crumbs-fac.herokuapp.com/
Good test coverage on server-side
use build script to add dummy data to database
Make at least one database test
We need to create a getdata.js with the right sorting in the query.
We need to create a server.js file.
Create pages for
Which inserts new rows into database tables.
See example:
https://github.com/foundersandcoders/pg-workshop/blob/master/solutions/src/queries/postData.js
handler.js should deal with endpoints:
(not sure if this all makes sense, feel free to modify!)
We need the redirect the add biscuit page to the biscuit browser page after the user has submitted data
After tests have run, you need to press CTRL + C to terminate them.
(possibly to do with pool/connection/timeout...??)
Remove these for consistency :)
In this file https://github.com/polyccon/Crumbs/blob/master/src/handler.js#L9-L16
You are defining the extensions, but what happens if you add png files, then add svg files to serve. You will constantly be adding to this list.
Have you thought about an alternative?
You could just split the url to get the ext.
var ext = url.split('.')[1];
// this will give you the extension as long as you have the url. which you can get from the request.
Good test coverage on the client-side
As we all know naming is hard but is probably the most important part of this process.
You have split out your routes and handlers in different files, which would be fine if your naming was consistent across both the files.
https://github.com/polyccon/Crumbs/blob/master/src/router.js#L7 the route is /get
but the actual handler is called queryGetData
try to keep some consistency in the naming, never assume that because you have this line
'/get': handlers.queryGetData,
that users will know exactly the method to look for in the handler and vice-versa.
Be more specific. What type of data are you getting? https://github.com/polyccon/Crumbs/blob/master/src/queries/getData.js#L2 it looks like biscuits, then call the endpoint biscuits
and then your method get-biscuits
.
Create the form submission request called by the submit button on the add biscuit page. Talks to the new_biscuit endpoint on the server
ie db_build.sql
travis builds will fail unless we set up our database on travis
when we test that we can insert into the database, our 'select' query must be inside the callback passed into the 'insert' query (or the selection may finish before the insertion)
https://github.com/polyccon/Crumbs/blob/master/test/database.test.js#L58
OR use returning: https://www.postgresql.org/docs/9.5/static/dml-returning.html
router.js should have endpoints:
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.