This file contains hidden or 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
const schema = Yup.object({ | |
dogBreed: Yup.string().required("Required") | |
}) | |
const options = [ | |
{ value: "terrier", label: "Terrier" }, | |
{ value: "hound", label: "Hound" }, | |
{ value: "corgie", label: "Corgie" }, | |
]; |
This file contains hidden or 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 { useField, FieldProps } from "formik"; | |
import Select, { Option, ReactSelectProps } from "react-select"; | |
import { ErrorMessage, SelectField, FieldLabel } from "./DropDown.styles"; | |
interface PropsType { | |
[x: string]: any; | |
name: string; | |
} | |
const DropDown: React.FC<ReactSelectProps & FieldProps> = ({ |
This file contains hidden or 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": "your-app", | |
"version": "0.1.0", | |
"private": true, | |
"license": "UNLICENSED", | |
"scripts": { | |
"dev": "next dev", | |
"build": "next build", | |
"start": "next start", | |
"lint": "eslint '*/**/*.{js,ts,tsx}' --fix", |
This file contains hidden or 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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es5", | |
"lib": ["dom", "dom.iterable", "esnext"], | |
"allowJs": true, | |
"skipLibCheck": true, | |
"strict": false, | |
"forceConsistentCasingInFileNames": true, | |
"noEmit": true, | |
"esModuleInterop": true, |
This file contains hidden or 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
module.exports = { | |
parser: "@typescript-eslint/parser", // Specifies the ESLint parser | |
parserOptions: { | |
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features | |
sourceType: "module", // Allows for the use of imports | |
ecmaFeatures: { | |
jsx: true, // Allows for the parsing of JSX | |
}, | |
}, | |
env: { |
This file contains hidden or 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
version: "3" | |
services: | |
web: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
container_name: web | |
restart: always | |
volumes: |
This file contains hidden or 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
FROM node:12.18.3 | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
ENV MONGO_URL "mongodb://mongo:27017" | |
ENV DB_NAME points | |
ENV COL_NAME dataPoints |
This file contains hidden or 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
const readAllRecords = db => { | |
const p = new Promise((resolve, reject) => { | |
db.collection(process.env.COL_NAME) | |
.find({}) | |
.toArray((error, results) => { | |
if (error) { | |
reject({ origin: "readAllRecords", error }); | |
return; | |
} |
This file contains hidden or 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 { MongoClient } from "mongodb"; | |
const openDbConnection = url => { | |
const p = new Promise((resolve, reject) => { | |
MongoClient.connect( | |
url, | |
{ useUnifiedTopology: true, useNewUrlParser: true }, | |
async (error, client) => { | |
if (error) { | |
reject(error); |
This file contains hidden or 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
version: "2" | |
services: | |
web: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
container_name: web | |
restart: always | |
ports: |