Skip to content

Instantly share code, notes, and snippets.

View pip-pipo's full-sized avatar
😇
Learning

Mr Morsalin pip-pipo

😇
Learning
View GitHub Profile
# API NAME DESCRIPTION SAMPLE URL
1 7Timer! Weather forecasts http://www.7timer.info/bin/api.pl?lon=113.17&lat=23.09&product=astro&output=json
2 Agify.io Predict age based on a name https://api.agify.io?name=bella
3 Archive.org Large public digital archive https://archive.org/advancedsearch.php?q=subject:google+sheets&output=json
4 Bored Activity suggestions https://www.boredapi.com/api/activity
5 Cat Facts List of cat facts https://cat-fact.herokuapp.com/facts
6 Cocktail Database Cocktail recipes https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita
7 CoinBase Currency codes and names https://api.coinbase.com/v2/currencies
8 CoinDesk Bitcoin price index https://api.coindesk.com/v1/bpi/currentprice.json
9 CoinGecko Exchange rates https://api.coingecko.com/api/v3/exchange_rates
@pip-pipo
pip-pipo / Rest_Api_Logic
Created February 27, 2021 15:34
Mern_stack_Rest_Api_Logic
import post from "../models/PostModel.js";
// get all post
export const getPost = async (req, res) => {
try {
await post.find((error, data) => {
if (error) {
console.log(error);
} else {
// console.log(data);
const User = require('../models/User');
const jwt = require('jsonwebtoken');
const config = require('config');
const bcrypt = require('bcrypt');
module.exports.signup = (req,res) => {
const { name, email, password } = req.body;
if(!name || !email || !password){
res.status(400).json({msg: 'Please enter all fields'});