Skip to content

Mariia-Zubkova#9

Open
mariia-zu wants to merge 2 commits intosanmaal:masterfrom
mariia-zu:master
Open

Mariia-Zubkova#9
mariia-zu wants to merge 2 commits intosanmaal:masterfrom
mariia-zu:master

Conversation

@mariia-zu
Copy link
Copy Markdown

No description provided.

Comment thread app.js
@@ -0,0 +1,18 @@
// app.js
var express = require('express');
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var в 2018 году так себе идея, используй const

Comment thread db.js
@@ -0,0 +1,3 @@
// db.js
var mongoose = require('mongoose');
mongoose.connect('mongodb://mary:mary123@ds227352.mlab.com:27352/pokemon_api'); No newline at end of file
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

спасибо за учетные данные ) но лучше их хранить в переменных окружения


// ADD A CATCHED POKEMON
router.post('/', function (req, res) {
Collection.create({
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

на сколько я знаю, монгус уже умеет в промисы, мне кажется стоит использовать их, а не колбеки

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

плюс поймать покемона может только авторизованый пользователь, не нашел, где это тут проверяется

Comment thread utils/dbInit.js
@@ -0,0 +1,9 @@
//1. open connect
//mongoost.connect.then
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и что у нас с dbInit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants