-
Notifications
You must be signed in to change notification settings - Fork 18
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
Layout #1
base: master
Are you sure you want to change the base?
Layout #1
Conversation
server/env-template.txt
Outdated
@@ -0,0 +1,9 @@ | |||
CLIENT_ID=397711291646-fgrnl8h2969mqm5fd2ufmjthm4kv36p5.apps.googleusercontent.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ketika membuat template, tidak perlu memasukan credential valuenya
server/app.js
Outdated
mongoose.connect( DATABASE_URL , { useNewUrlParser : true }) | ||
.then( () => { console.log( `Database connected to: ${DATABASE_URL}` ); }) | ||
.catch( err =>{ console.log( err ); }) | ||
mongoose.set('useCreateIndex', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bisa dijadikan satu di confignya saat connect
type : String, | ||
required : true | ||
}, | ||
email : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kenapa tidak dibuat untuk check unique?
let status ; | ||
let message; | ||
|
||
if ( err.name == 'ValidationError' ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jangan hanya seperti ini, jadi sia-sia jika sudah membuat custom message di validasi model. gunakan custom message untuk dikirimkan ke client
|
||
// Check if the user bring token; if not let user know they must login | ||
function authentication ( req ,res , next ) { | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tips: ada pengecekan user apakah masih ada atau tidak di database
@@ -0,0 +1,117 @@ | |||
const Article = require('../models/article'); | |||
class ArticleController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tidak selalu semuanya populate data user, karena akan mendapatkan passwordnya
}) | ||
return; | ||
} | ||
if ( !this.file ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jika ketika edit tidak mengirimkan photo, bisa menggunakan photo yang lain
Cado, sekali lagi mengingatkan yaa :D
mohon konsistensi ketika memberika spasi setelah (), jika memang itu yang dipilih berarti semuanya juga harus diubah seperti itu, semisal:
jadi kalo diperhatiin ada ketidak konsistenan (biasanya) di akhir coding berikut tambahan lainnya:
overall sudah OK, jika ada tambahan dan perubahan, kabari instructor |
.env template ada di folder server "env-template"
CLIENT_ID=397711291646-fgrnl8h2969mqm5fd2ufmjthm4kv36p5.apps.googleusercontent.com
PORT=3000
DATABASE_URL=mongodb://localhost:27017/mini-wp
SECRET_JWT=SECRETWOI
SALT_ROUND=10
DEFAULT_PASSWORD=DEFAULT
CLOUD_BUCKET=deeppress
GCLOUD_PROJECT=deeppress
KEYFILE_PATH=keyfile.json
Feature Tambahan:
Kendala :
link : http://deeppress.cado.store/