> For the complete documentation index, see [llms.txt](https://xml-1.gitbook.io/vuejs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xml-1.gitbook.io/vuejs/chinh-sua-url-mac-dinh-cua-json-server-vi-du-them-api-vao-duong-dan-ok.md).

# Chỉnh sửa url mặc định của json-server ví dụ thêm /api vào đường dẫn (ok)

C:\xampp\htdocs\api\db.json

```
{
  "posts": [
    { "id": 1, "title": "json-server", "author": "typicode" },
    { "id": 1, "title": "json-server", "author": "typicode" },
    { "id": 1, "title": "json-server", "author": "typicode" },
    { "id": 1, "title": "json-server", "author": "typicode" },
    { "id": 1, "title": "json-server", "author": "typicode" }
  ]
}
```

C:\xampp\htdocs\api\package.json

```
{
  "name": "api",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "node main.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "json-server": "^0.17.0"
  },
  "devDependencies": {
    "nodemon": "^2.0.15"
  }
}

```

![](https://3659937222-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzKaxpAhzEszGTfXN0vQI%2Fuploads%2F9O87Xh0oSytZaxyF7nti%2FScreenshot_3.png?alt=media\&token=6605a1b6-80fc-496a-854e-90d41c3680db)
