Express routing problem

I am a novice. I have just come into contact with the node.js and express frameworks. I have configured routing according to the online tutorial, but there are some problems, as follows:

first of all, the file structure is as follows:

clipboard.png

index.js:

 

try to solve it by yourself. If the routes/index.js and routes/about.js files are written into the index.js file (without module export), then the about page can respond normally, but not in different modules.

I have just come into contact with this aspect, and I don"t quite understand what the problem is. I hope I can have some guidance from my predecessors. Thank you.


app.use('/about', userRouter.router)

router.get('/about', (req, res) => {

look at your code. The correct path to about should be http://localhost:3000/about/about

.

you changed it to

in about.js.
router.get('/', (req, res) => {
    res.send('about')
})

try

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea4ab9-47acc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea4ab9-47acc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?