vue-router-sitemap icon indicating copy to clipboard operation
vue-router-sitemap copied to clipboard

Uncaught TypeError: app.get is not a function

Open milad777v2 opened this issue 5 years ago • 5 comments

hi, whats this error? app.get('/sitemap.xml', sitemapMiddleware());

milad777v2 avatar Dec 26 '19 11:12 milad777v2

I have the same issue.

ludvig-flemmich avatar Feb 04 '20 11:02 ludvig-flemmich

Hi, I'm having the same issue, did you guys get this working?

ShapesGraphicStudio avatar Mar 12 '20 16:03 ShapesGraphicStudio

Hello here, something new on this issue?

kagaramag avatar Apr 02 '20 00:04 kagaramag

Seems that this project is already abandoned? I have no idea about how to use it.

panhaoyu avatar May 13 '20 02:05 panhaoyu

Hi, You can use vue router middleware in the case of app.get('sitemap'). Let's say you have a router link like so.. `{ path: '/', name: 'index', component: Index, }

// You can add a new meta field with middleware so it would be { path: '/', name: 'index', component: Index, meta: { middleware: sitemapMiddleware // This is a file in middleware folder in your src directory. As documented in this libs docs },

,

Since you have generated a new sitemap.xml in your public directory. i.e so that it can be accessed anywhere like your favicon.ico The sitemap.xml can be accessed using e.g localhost:8080/sitemap.xml. I hope this makes sense...

`

BrianMwas avatar Jun 27 '20 08:06 BrianMwas