Gatsby: I want to run my blog on site name.com/blog ?

Created on 8 Jun 2018  路  4Comments  路  Source: gatsbyjs/gatsby

I want to run buy Gatsby blog on mysitename.com/blog but I am unable to specify that whenever Gatsby run it should run on sitename.com/blog instead of 'site name.com/'

can someone help me with that ?
TIA

question or discussion

Most helpful comment

@m-allanson Thanks man! I was just missing not to put the slash.

Thanks a bunch.

All 4 comments

Check out the path prefix docs: https://www.gatsbyjs.org/docs/path-prefix/

@m-allanson Thanks man! I was just missing not to put the slash.

Thanks a bunch.

@m-allanson Hey I wanted to ask another thing that is if I have my site running on node and I want to say that all the /blog/* routes are to be handled by Gatsby,

app.get('/blog', function (req, res, next) {

    res.sendFile((path.join(__dirname, 'blog/public', 'index.html')));
});

I have written this its rendered the index page that is the list of all blogs but it doesn't do any further routing ?
How do I support that ? Any help regarding that would be great!

Thanks in advance.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

magicly picture magicly  路  3Comments

theduke picture theduke  路  3Comments

andykais picture andykais  路  3Comments