Skip to content

Instantly share code, notes, and snippets.

View stivncastillo's full-sized avatar
🎯
Focused

Stiven Castillo stivncastillo

🎯
Focused
View GitHub Profile
@stivncastillo
stivncastillo / App.js
Created August 8, 2021 21:04
Final app
import React from "react";
import Routes from "./router";
function App() {
return (
<Routes />
);
}
export default App;
import React from 'react'
import {
BrowserRouter as Router,
Switch,
Route,
Link,
} from "react-router-dom";
import routes from './routes';
import { PrivateRoute } from "./types.js";
@stivncastillo
stivncastillo / types.jsx
Last active August 8, 2021 21:18
Types routes
import React from "react";
import { Redirect, Route } from "react-router-dom";
export const PrivateRoute = ({ component: Component, ...rest }) => {
return (
<Route
{...rest}
render={(props) =>
localStorage.getItem("isAuth") === "true" ? (
<Component {...props} />
@stivncastillo
stivncastillo / routes.jsx
Created August 8, 2021 20:38
Routes of private routes
import DashboardPage from "../pages/DashboardPage";
import LoginPage from "../pages/LoginPage";
import ProfilePage from "../pages/ProfilePage";
const routes = {
private: [
{
path: "/",
name: "dashboard",
component: DashboardPage
import React from "react";
import {
BrowserRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";
// pages
import LoginPage from './pages/LoginPage'
import DashboardPage from './pages/DashboardPage'
@stivncastillo
stivncastillo / DashboardPage.jsx
Last active August 8, 2021 20:04
Nested Routes
import React from 'react'
const DashboardPage = () => {
return (
<div>
Private Dashsboard
</div>
)
}
@stivncastillo
stivncastillo / eslint.json
Last active August 18, 2019 04:38
Eslint file
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"airbnb"
],
"globals": {
"Atomics": "readonly",
module.exports = {
development: {
client: 'postgresql',
connection: {
port: process.env.DATABASE_PORT,
host: process.env.DATABASE_HOST,
database: process.env.DATABASE_NAME,
user: process.env.DATABASE_USER,
password: process.env.DATABASE_ACCESS_KEY,
},
La estructura para los proyectos en el servidor de Staging estan de la siguiente manera:
Repositorios
Aquí se definen los espejos (–mirror) de los repositorios de bitbucket.
/home/ubuntu/repos
Para ir a esta carpeta desde cualquier sitio del servidor se ingresa el comando:
{
"extends": "airbnb",
"parser": "babel-eslint",
"env": {
"browser": true
},
"plugins": [
"react"
],
"rules": {