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
// src/index.js | |
import Page1 from './Page1'; | |
import Page2 from './Page2'; | |
import { createDrawerNavigator } from 'react-navigation'; | |
const DrawerNavigator = createDrawerNavigator({ | |
Home: Page1, | |
About: Page2, |
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 app = express(); | |
// Middleware #1 | |
app.get('/', (req, res, next) => { | |
res.locals.hello = 'Hello World'; | |
next(); | |
}); |
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
// Middleware #1 | |
app.use((req, res, next) => { | |
res.locals.hello = 'Hello World'; | |
next(); | |
}); | |
// Middleware #2 | |
app.get('/', (req, res) => { | |
return res.send(res.locals.hello); | |
}); |
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
app.use('/app', (req, res, next) => { | |
if (!usuariologado) { | |
return res.redirect(); | |
} | |
next(); | |
}); |
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
// Middleware #1 | |
app.use((req, res, next) => { | |
res.locals.hello = 'Hello World'; | |
next(); | |
}); |
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
// Middleware #2 | |
app.get('/', (req, res) => { | |
return res.send(res.locals.hello); | |
}); |
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
// Middleware #3 | |
app.get('/', (req, res) => { | |
res.send('Eu nunca serei chamado! T.T'); | |
}); |
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
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> |
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 ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
ReactDOM.render(<App />, document.getElementById('root')); |
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
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>React + Material | RocketSeat</title> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | |
</head> | |
<body> |