Last active
February 27, 2018 21:04
-
-
Save vickonrails/4e46fd3e0ca2c4d4222cecaa83e5e5b9 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
const express = require('express'), | |
app = express(); | |
//requiring the basic_router.js | |
app.use('/users',require('.react-router/basic_router')); | |
//routes | |
app.get('/posts/newpost',(request,response)=>{ | |
response.send('new post'); | |
}); | |
app.get('/api',(request,response)=>{ | |
response.send('API route'); | |
}); | |
app.listen(3000,()=>console.log('Express server started at port 3000')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 5
app.use('/users',require('.react-router/basic_router'));
should be:You miss the
/
in the react-router folder