Created
May 11, 2019 07:30
-
-
Save alshdavid/abb2ee5fbd2ad2f14c09508e45395295 to your computer and use it in GitHub Desktop.
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 crayon from 'crayon'; | |
import react from 'crayon/react'; | |
import transition from 'crayon/transition'; | |
import { Home } from './pages/home' | |
import { More } from './pages/more' | |
import { About } from './pages/about' | |
import './index.css' | |
const app = crayon.create() | |
app.use(react.router()) | |
app.use(transition.loader()) | |
app.use(crayon.animate({ | |
name: transition.fade, | |
duration: 300, | |
routes: [ | |
{ from: '/**', to: '/more', name: transition.slideLeft }, | |
{ from: '/more', to: '/**', name: transition.slideRight } | |
] | |
})) | |
app.path('/', (req, res) => res.redirect('/home')) | |
app.path('/home', (req, res) => | |
res.mount(Home(req, app)) | |
) | |
app.path('/about', (req, res) => | |
res.mount(About(req, app)) | |
) | |
app.path('/more', (req, res) => | |
res.mount(More(req, app)) | |
) | |
app.load() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment