articles-products-and-express's People
articles-products-and-express's Issues
Application crashes if analytics log file does not exist
Error: ENOENT: no such file or directory, open './logs/analytics.log'
Please handle this error gracefully with proper handling. Discuss below what your solution might be.
project missing dependency body-parser
Make user registration and login work with database and crypto.
Index routes for both resources display templating error if database is empty
Steps to reproduce:
- Fresh install of Application and Database.
- Start application
- visit url: http://localhost:3000/products or http://localhost:3000/articles
Notice Templating error
Discuss solution below.
Update logic in your controllers to use Promise pattern instead of callbacks
Currently code in your controllers (routes/
) communicate to your models with callback functions. Consider implementing the Promise pattern.
You will have to craft your own Promise which is returned from your model module to your controller files.
Your model's getAll
function should return a promise.
Internal to getAll
function, should still be using pg-promise to query and retrieve data from the database. except this time you will either resolve
or reject
your crafted Promise.
better db pattern
As far as pg-promise
goes, the best pattern for the database layer is shown in pg-promise-demo.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.