I used the webpack dev server to run the local web server.
When I used browser enter the url zabbix_get= \
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": "extend",
"host": "server01",
# "host": "server01"
"search": {
"key_": 'vfs.fs.size[/data,free]','system.cpu.util.usage'
},
"sortfield": "name"
},
"auth": authToken.get("result"),
"id": authToken.get("id")
}
and I got the error.
Can not get /sign_in
I add a Object /localhost:8080/sign_in
in my historyApiFallback: true
and it was solved.
webpack.config.js
But when I compiled devServer: {
inline: true,
port: 8080,
historyApiFallback: true,
headers:{
'Access-Control-Allow-Origin': '*',
"Access-Control-Allow-Methods": "POST, GET, OPTIONS"
}
}
and run the webpack -p
the same error was happened again.
followed node server.js
code
server.js
How can I fixed it?
答案 0 :(得分:1)
You haven't defined your route for sign-in.
TYPOSCRIPT configuration
since server side rendering is not active, you cannot go directly to sign-in. You will have to go to index and click on link so react-router can go to that path