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 { Box, Container, Grid } from '@material-ui/core'; | |
import InffectedCountryList from './components/inffectedCountry/InffectedCountryList'; | |
import InffectedCountryMap from './components/inffectedCountry/InffectedCountryMap'; | |
function App() { | |
let [inffectedCountries, setinffectedCountries] = useState([]); | |
let [updatedAt, setUpdatedAt] = useState([]); |
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 GoogleMapReact from 'google-map-react'; | |
import { Avatar, Chip } from '@material-ui/core'; | |
const FlagPin = ({ urlFlag, cases }) => ( | |
<Chip avatar={<Avatar src={urlFlag} />} label={`${cases} casos`} /> | |
); | |
export default function InffectedCountryMap({ inffectedCountries }) { | |
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 from 'react'; | |
import { Container, Grid } from '@material-ui/core'; | |
import InffectedCountryCard from './InffectedCountryCard'; | |
export default function InffectedCountryList({ inffectedCountries, updatedAt }) { | |
return ( | |
<Container> | |
<h1 style={{ marginBottom: '0' }}>Paises infectados</h1> | |
<p style={{ color: '#0e5077', marginTop: '0' }}>actualizado al {updatedAt}</p> |
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 { Card, CardHeader, Avatar, CardContent, Grid } from '@material-ui/core'; | |
export default function InffectedCountryCard({ | |
urlFlag, | |
country_name, | |
cases, | |
deaths, | |
total_recovered, | |
}) { |
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
# dependencies | |
/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
#Definimos el la version de node que tendrá mi contenedor | |
FROM node:12.3.0-alpine | |
#Defino el directorio en donde se va a ejecutar mi configuración dentro del contenedor | |
WORKDIR /home/apps/tuto | |
#Copio el archivo package.js para posteriormente instalar las dependencias de mi repositorio | |
COPY package*.json ./ | |
RUN npm install | |
#Instalo de manera global pm2 | |
RUN npm install pm2 -g |
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 express = require('express'); | |
const path = require('path'); | |
const http = require('http'); | |
const process = require('process'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
// CONFIGURO LAS RUTAS DE MI API | |
const api = require('./rutas/api'); |
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
http { | |
# OTRAS CONFIGURACIONES | |
#... | |
# CONFIGURAMOS NUESTRO PUERTO 443 PUERTO SEGURO | |
server { | |
listen 443 ssl http2 default_server; | |
listen [::]:443 ssl http2 default_server; | |
server_name _; | |
root /usr/share/nginx/html; |