This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post('/signin', function(req, res) { | |
User.findOne({ | |
username: req.body.username | |
}, function(err, user) { | |
if (err) throw err; | |
if (!user) { | |
res.status(401).send({success: false, msg: 'Authentication failed. User not found.'}); | |
} else { | |
// check if password matches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import axios from 'axios'; | |
export default class Search extends Component { | |
constructor(){ | |
super(); | |
this.state = { | |
list: [], | |
filteredList: [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from flask import Flask, jsonify, url_for, redirect, request | |
from flask_pymongo import PyMongo | |
from flask_restful import Api, Resource | |
app = Flask(__name__) | |
app.config["MONGO_DBNAME"] = "students_db" | |
mongo = PyMongo(app, config_prefix='MONGO') | |
APP_URL = "http://127.0.0.1:5000" |