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 api from '../api'; | |
export const fetchTopUsersBySize = async (size: number = 30) => { | |
const response = await api.get( | |
`/search/users?q=followers:>1000&sort=followers&order=desc&per_page=${size}` | |
); | |
return response.data; | |
}; | |
export const fetchUserBySearch = async (text: string) => { |
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 from "react"; | |
import axios from "axios"; | |
const API = "https://fakestoreapi.com"; | |
export default function useAxios(path, method, body) { | |
const [response, setResponse] = React.useState(null); | |
const [loading, setLoading] = React.useState(true); | |
React.useEffect(() => { |
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
name: tests-auth | |
on: | |
pull_request: | |
paths: | |
- 'auth/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
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 express, { Request, Response } from "express"; | |
import { User } from "../models/user"; | |
import { body, check, validationResult } from "express-validator"; | |
const router = express.Router(); | |
router.post( | |
"/api/users/signup", | |
[ | |
body("firstName") | |
.trim() |
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 express, { Request, Response } from "express"; | |
import { body, check, validationResult } from "express-validator"; | |
const router = express.Router(); | |
router.post( | |
"/api/users/signup", | |
[ | |
body("firstName") | |
.trim() | |
.not() |
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 request from "supertest"; | |
import { app } from "../../app"; | |
it("Should not allow to create user without first name", async () => { | |
return request(app) | |
.post("/api/users/signup") | |
.send({ | |
lastName: "Abc", | |
email: "[email protected]", | |
password: "12345678", |
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 { MongoMemoryServer } from "mongodb-memory-server"; | |
import mongoose from "mongoose"; | |
let mongo: any; | |
// Start mongo server before start running test | |
beforeAll(async () => { | |
mongo = new MongoMemoryServer(); |
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
apiVersion: skaffold/v2alpha3 | |
kind: Config | |
deploy: | |
kubectl: | |
manifests: | |
- ./infra/k8s/* | |
build: | |
local: | |
push: false | |
artifacts: |
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
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: ingress-service | |
annotations: | |
kubernetes.io/ingress.class: nginx | |
nginx.ingress.kubernetes.io/use-regex: "true" | |
spec: | |
rules: | |
- host: quiz.com |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: auth-mongo-depl | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: auth-mongo | |
template: |
NewerOlder