我正在尝试查看post请求是否会在'/db‘路由上在我的服务器上工作。get请求工作得很好,但是“Post”请求提供了“404”未找到的错误。
(部分)我的js代码:
function getReq() {
let p = fetch("http://localhost:3000/db").then((a)=>a.json()).then((x)=>console.log(x))
}
async function postReq(obj) {
console.log(obj)
const p = await
我一次又一次地面对同样的错误:
XMLHttpRequest cannot load http://localhost:3000/form. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access. The response had HTTP status code 404.
我读过无数类似于这篇文章的文章,它们几乎都有相同的答案,即添加以
一个剩馀的问题--为了学习它,我尝试制作一个简单的博客应用程序。我正在尝试加载一个帖子索引,但得到的是错误
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/api/osts
这是有道理的,因为它应该是
http://localhost:3000/api/posts
我在这里犯了什么错误?->
Blog.Post = DS.Model.extend({});
Blog.PostsRoute = Ember.Route.extend({