Serve: Where to locate serve.json file ?

Created on 29 May 2018  路  3Comments  路  Source: vercel/serve

I've created serve.json file at root of serving directory, but any of this configuration not applied when I run serve
{ "headers": [ { "headers" : [{ "source" : "index.html", "key" : "Access-Control-Allow-Origin", "value" : "*" }] }], "directoryListing": false, "trailingSlash": true }

Most helpful comment

I know this is a closed issue, but I think this should be better documented somewhere. I couldn't find this information anywhere.

All 3 comments

@Olexiy665 What was the command you ran?

In order to use the config file, you need to place it in the current working directory (the one from which you ran the command).

However, if you run something like serve build, the configuration file needs to be placed inside the "build" directory, in order for it to work.

I know this is a closed issue, but I think this should be better documented somewhere. I couldn't find this information anywhere.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

k7sleeper picture k7sleeper  路  7Comments

ghost picture ghost  路  7Comments

xiyuyizhi picture xiyuyizhi  路  5Comments

malinda1986 picture malinda1986  路  6Comments

nikitamendelbaum picture nikitamendelbaum  路  6Comments