-
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
Muhamad Fadhil Surya Putra #9
base: master
Are you sure you want to change the base?
Conversation
tidak ada .env, server tidak bisa dijalankan |
# fancy-todo |
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.
biasanya ada di folder server
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.
PASSWORD="susumurninasional"
JWT_SALT="garam"
GOOGLE_CLIENT_ID="895491504741-7fvkjjp5p3fa3jn3hljfl4juhcrqde4h.apps.googleusercontent.com"
MONGOATLAS=mongodb+srv://fadhilsurya:[email protected]/test?retryWrites=true&w=majority
berikut mas untuk envnya
@@ -0,0 +1,32 @@ | |||
require('dotenv').config() |
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.
berikan kondisi untuk proses development menggunakan dotenv
router.post('/', todoController.create) | ||
router.get('/search', todoController.search) | ||
|
||
router.get('/:id', todoController.findById) |
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.
ini juga sebaiknya menggunakan authorized
@@ -0,0 +1,27 @@ | |||
function errorHandler(err, req, res, next) { | |||
if (err.name == 'JsonWebTokenError') { |
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 dihandle errornya di sini, berarti di authentication tidak perlu kirim next status dan message
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.
siap mas akan di update
sebaiknya jika sudah selesai, console.log nya dihapus |
jika ada perbaikan (info dotenv) dan deploy, kabari instruktur |
No description provided.