Skip to content

Instantly share code, notes, and snippets.

View thianlopezz's full-sized avatar

Thian Lopez Zambrano thianlopezz

View GitHub Profile
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([]);
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 (
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>
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,
}) {
# dependencies
/node_modules
@thianlopezz
thianlopezz / dockerfile
Created October 30, 2019 18:34
Configuración para dockerizar un app de nodejs con pm2
#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
@thianlopezz
thianlopezz / server.js
Created October 30, 2019 16:21
Configuración simple de un servidor en NodeJs
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');
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;