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
let dbURI; | |
if (process.env.NODE_ENV ==='development'){ | |
dbURI = process.env.DATABASE_LOCAL_DB | |
} | |
if (process.env.NODE_ENV ==='test'){ | |
dbURI = process.env.DATABASE_TEST_DB | |
} | |
if (process.env.NODE_ENV ==='production'){ | |
dbURI = process.env.DATABASE_PROD_DB | |
} |
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
NODE_ENV=development | |
DATABASE_DEV_URL=<insert_URI_to_local_db> | |
DATABASE_TEST_URL=<insert_URI_to_test_db> | |
DATABASE_PROD_URL=<insert_URI_to_prod_db> |
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
node_modules |
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
version: '3.7' | |
services: | |
web: | |
stdin_open: true | |
image: #insert app name | |
build: | |
context: . | |
dockerfile: Dockerfile.dev | |
volumes: |
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
# base image that comes with NodeJS | |
FROM node:14.15-alpine | |
# set working directory inside Docker container | |
WORKDIR /app | |
# add node to path to access npm commands from cli | |
ENV PATH /app/node_modules/.bin:$PATH | |
# copy package.json and package-lock to install dependencies in Docker container |
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
class Solution: | |
def reverseList(self, head: ListNode) -> ListNode: | |
# check if head exists or if there are at least 2 nodes. | |
if head is None or head.next is None: | |
return head | |
else: | |
current_node = head | |
while current_node.next is not None: | |
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
const ProjectCard = (props) => { | |
const renderDemoButton = () => { | |
if (props.demo === ""){ | |
return ( | |
<button className="ui disabled button"> | |
Demo | |
</button> | |
) |
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
const Projects = () => { | |
const [projectInfo,setProjectInfo] = useState([]); | |
const fetchProjects = async () =>{ | |
const response = await projects.get('/projects/') | |
setProjectInfo(response.data) | |
} | |
const createProjectCards = () => { | |
return( |
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, {useState,useEffect} from 'react' | |
import ProjectCard from './ProjectCard' | |
import projects from '../apis/projects' | |
const Projects = () => { | |
const [projectInfo,setProjectInfo] = useState([]); | |
const fetchProjects = async () =>{ | |
const response = await projects.get('/projects/') | |
setProjectInfo(response.data) |
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 axios from 'axios' | |
export default axios.create({ | |
baseURL:'http://localhost:8000/api' | |
}) |
NewerOlder