Skip to content

Commit d08371e

Browse files
derrickmehaffyazulkiplialexkainzingerGeoFropwizla
authored
Deploy Fixes to Production (Mid-Dec) (#599)
* auth route v4 (#553) i found that default authentication route should be `/api/auth/local` * fix: typo in backend-customization/middlewares.md (#557) * Update i18n.md (#564) Co-authored-by: Pierre Wizla <[email protected]> * Added API suffix (#556) Co-authored-by: Pierre Wizla <[email protected]> * fix wrong uid (#558) Signed-off-by: harimkims <[email protected]> Co-authored-by: Pierre Wizla <[email protected]> * default route user register in v4 (#554) I found that default route user register in v4 is `api/auth/local/register` Co-authored-by: DMehaffy <[email protected]> Co-authored-by: Pierre Wizla <[email protected]> * Fix remaining localhost links (#568) * Fix wrong syntax in GraphQL plugin docs (#537) Signed-off-by: harimkims <[email protected]> Co-authored-by: Pierre Wizla <[email protected]> * Fix wrong parameter name in connection.connection (#559) In the documentation about the connection parameters, the `username` parameter does not actually exist. This is probably a typo and should be replaced by the `user` parameter as per the example given below on the same page. Co-authored-by: DMehaffy <[email protected]> Co-authored-by: Pierre Wizla <[email protected]> * Fix broken links in GraphQL & i18n (#583) * Update default MySQL Port (#575) Update default MySQL Port in example to 3306 Co-authored-by: Pierre Wizla <[email protected]> * Add closing parenthesis to predefined hook code example (#589) * 📖 ⬆️ bump Mysql/MariaDB minimum verison (#593) - bump MyQL/MariaDB Minimum Version for `JSON` datatype support * Update controllers.md (#586) There should be two enclosing parenthesis at the end. Co-authored-by: Pierre Wizla <[email protected]> * Fix config example for GraphQL (#591) Co-authored-by: Pierre Wizla <[email protected]> * docs: One-to-One should use singular in example (#570) Co-authored-by: Pierre Wizla <[email protected]> * Remaining auth v4 changes (#565) There are still some references to the v3 auth endpoints (without `/api` at the start) on the Users and Permissions plugin documentation. # What does it do? Updates Strapi endpoints to include `/api` at the start # Why is it needed? This change should be documented; it caused a lot of confusion for me as I was trying to figure out why my authentication was not working on v4. # Related issue(s)/PR(s) A similar thing was fixed for the guides in PR #553 Co-authored-by: Pierre Wizla <[email protected]> Co-authored-by: DMehaffy <[email protected]> * lifecycles.js file is not generated automatically (#566) * lifecycles.js file is not generated automatically I think since version 4, the lifecycles.js file is not created automatically but needs to be created manually, if needed. Postscript Correct me if I'm wrong. You can also rephrase this change if it is relevant and true. Thanks * Update docs/developer-docs/latest/development/backend-customization/models.md Co-authored-by: DMehaffy <[email protected]> * Update docs/developer-docs/latest/development/backend-customization/models.md Co-authored-by: Pierre Wizla <[email protected]> Co-authored-by: DMehaffy <[email protected]> Co-authored-by: Pierre Wizla <[email protected]> Co-authored-by: azulkipli <[email protected]> Co-authored-by: Alexander Kainzinger <[email protected]> Co-authored-by: George F <[email protected]> Co-authored-by: Pierre Wizla <[email protected]> Co-authored-by: Precious Luke <[email protected]> Co-authored-by: Kim, Harim <[email protected]> Co-authored-by: Camille Briand <[email protected]> Co-authored-by: Adam Miedema <[email protected]> Co-authored-by: YoRolling <[email protected]> Co-authored-by: Zeeshan Tariq <[email protected]> Co-authored-by: smoothdvd <[email protected]> Co-authored-by: arielbk <[email protected]> Co-authored-by: Adiel Ben Moshe <[email protected]>
1 parent ef966b6 commit d08371e

File tree

27 files changed

+189
-191
lines changed

27 files changed

+189
-191
lines changed

docs/developer-docs/latest/developer-resources/content-api/integrations/11ty.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/c
88

99
!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!!
1010

11-
This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants).
11+
This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/api/restaurants).
1212

1313
If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [11ty](https://www.11ty.dev/) remains the same except that you will not fetch the same content.
1414

@@ -139,7 +139,7 @@ const { default: axios } = require('axios');
139139

140140
module.exports = async () => {
141141
try {
142-
const res = await axios.get('http://localhost:1337/restaurants');
142+
const res = await axios.get('http://localhost:1337/api/restaurants');
143143
return res.data;
144144
} catch (error) {
145145
console.error(error);
@@ -195,7 +195,7 @@ const { default: axios } = require('axios');
195195

196196
module.exports = async () => {
197197
try {
198-
const res = await axios.get('http://localhost:1337/restaurants');
198+
const res = await axios.get('http://localhost:1337/api/restaurants');
199199
return res.data;
200200
} catch (error) {
201201
console.error(error);
@@ -261,7 +261,7 @@ const { default: axios } = require('axios');
261261

262262
module.exports = async () => {
263263
try {
264-
const res = await axios.get('http://localhost:1337/categories');
264+
const res = await axios.get('http://localhost:1337/api/categories');
265265
return res.data;
266266
} catch (error) {
267267
console.error(error);
@@ -328,7 +328,7 @@ const { default: axios } = require('axios');
328328

329329
module.exports = async () => {
330330
try {
331-
const res = await axios.get('http://localhost:1337/categories');
331+
const res = await axios.get('http://localhost:1337/api/categories');
332332
return res.data;
333333
} catch (error) {
334334
console.error(error);

docs/developer-docs/latest/developer-resources/content-api/integrations/angular.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/c
88

99
!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!!
1010

11-
This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants).
11+
This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/api/restaurants).
1212

1313
If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Angular](https://angular.io) remains the same except that you will not fetch the same content.
1414

@@ -56,7 +56,7 @@ Be sure that you activated the `find` permission for the `restaurant` Collection
5656
```js
5757
import axios from 'axios';
5858

59-
axios.get('http://localhost:1337/restaurants').then(response => {
59+
axios.get('http://localhost:1337/api/restaurants').then(response => {
6060
console.log(response);
6161
});
6262
```
@@ -68,7 +68,7 @@ axios.get('http://localhost:1337/restaurants').then(response => {
6868

6969
::: request Example GET request with fetch
7070
```js
71-
fetch('http://localhost:1337/restaurants', {
71+
fetch('http://localhost:1337/api/restaurants', {
7272
method: 'GET',
7373
headers: {
7474
'Content-Type': 'application/json',
@@ -142,7 +142,7 @@ export class AppComponent implements OnInit {
142142

143143
async ngOnInit() {
144144
try {
145-
const response = await axios.get('http://localhost:1337/restaurants');
145+
const response = await axios.get('http://localhost:1337/api/restaurants');
146146
this.restaurants = response.data;
147147
} catch (error) {
148148
this.error = error;
@@ -187,7 +187,7 @@ export class AppComponent implements OnInit {
187187

188188
async ngOnInit() {
189189
try {
190-
const restaurants = await fetch('http://localhost:1337/restaurants', {
190+
const restaurants = await fetch('http://localhost:1337/api/restaurants', {
191191
method: 'GET',
192192
headers: headers,
193193
})
@@ -234,7 +234,7 @@ In this example a `japanese` category has been created which has the id: 3.
234234
import axios from 'axios';
235235

236236
axios
237-
.post('http://localhost:1337/restaurants', {
237+
.post('http://localhost:1337/api/restaurants', {
238238
name: 'Dolemon Sushi',
239239
description: 'Unmissable Japanese Sushi restaurant. The cheese and salmon makis are delicious',
240240
categories: [3],
@@ -251,7 +251,7 @@ axios
251251

252252
::: request Example POST request with fetch
253253
```js
254-
fetch('http://localhost:1337/restaurants', {
254+
fetch('http://localhost:1337/api/restaurants', {
255255
method: 'POST',
256256
headers: {
257257
'Content-Type': 'application/json',
@@ -370,7 +370,7 @@ export class AppComponent implements OnInit {
370370

371371
async ngOnInit() {
372372
try {
373-
const response = await axios.get('http://localhost:1337/categories');
373+
const response = await axios.get('http://localhost:1337/api/categories');
374374
this.allCategories = response.data
375375
} catch (error) {
376376
this.error = error
@@ -381,7 +381,7 @@ export class AppComponent implements OnInit {
381381
async onSubmit(restaurantData) {
382382
try {
383383
const response = await axios.post(
384-
'http://localhost:1337/restaurants',
384+
'http://localhost:1337/api/restaurants',
385385
restaurantData
386386
);
387387
console.log(response);
@@ -463,7 +463,7 @@ export class AppComponent implements OnInit {
463463

464464
async ngOnInit() {
465465
try {
466-
const allCategories = await fetch('http://localhost:1337/categories', {
466+
const allCategories = await fetch('http://localhost:1337/api/categories', {
467467
method: 'GET',
468468
headers: headers,
469469
})
@@ -478,7 +478,7 @@ export class AppComponent implements OnInit {
478478

479479
async onSubmit(restaurantData) {
480480
try {
481-
await fetch('http://localhost:1337/restaurants', {
481+
await fetch('http://localhost:1337/api/restaurants', {
482482
method: 'POST',
483483
headers: headers,
484484
body: JSON.stringify(restaurantData),
@@ -550,7 +550,7 @@ and the id of your category is `2`.
550550
import axios from 'axios';
551551

552552
axios
553-
.put('http://localhost:1337/restaurants/2', {
553+
.put('http://localhost:1337/api/restaurants/2', {
554554
categories: [2],
555555
})
556556
.then(response => {
@@ -565,7 +565,7 @@ axios
565565
::: request Example PUT request with fetch
566566

567567
```js
568-
fetch('http://localhost:1337/restaurants/2', {
568+
fetch('http://localhost:1337/api/restaurants/2', {
569569
method: 'PUT',
570570
headers: {
571571
'Content-Type': 'application/json',

docs/developer-docs/latest/developer-resources/content-api/integrations/go.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/c
88

99
!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!!
1010

11-
This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants).
11+
This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/api/restaurants).
1212

1313
If you haven't gone through the Quick Start guide, the way you request a Strapi API with [GO](https://golang.org/) remains the same except that you will not fetch the same content.
1414

@@ -35,7 +35,7 @@ Be sure that you activated the `find` permission for the `restaurant` Collection
3535
::: request Example GET request
3636

3737
```go
38-
response, error := http.Get("http://localhost:1337/restaurants")
38+
response, error := http.Get("http://localhost:1337/api/restaurants")
3939
```
4040
:::
4141

@@ -87,7 +87,7 @@ func main() {
8787

8888
func getD() {
8989
fmt.Println("Getting data...")
90-
res, error := http.Get("http://localhost:1337/restaurants")
90+
res, error := http.Get("http://localhost:1337/api/restaurants")
9191
if error != nil {
9292
fmt.Printf("The HTTP request failed with error %s\n", error)
9393
} else {
@@ -111,7 +111,7 @@ postRest, _ := json.Marshal(map[string]string{
111111
"description": "This is a very nice place to eat native soup",
112112
})
113113
responseBody := bytes.NewBuffer(postRest)
114-
resp, error := http.Post("http://localhost:1337/restaurants", "application/json", responseBody)
114+
resp, error := http.Post("http://localhost:1337/api/restaurants", "application/json", responseBody)
115115
```
116116
:::
117117

@@ -150,7 +150,7 @@ func main() {
150150

151151
func getD() {
152152
fmt.Println("Getting data...")
153-
resp, error := http.Get("http://localhost:1337/restaurants")
153+
resp, error := http.Get("http://localhost:1337/api/restaurants")
154154
if error != nil {
155155
fmt.Printf("The HTTP request failed with error %s\n", error)
156156
} else {
@@ -167,7 +167,7 @@ func postD() {
167167
"description": "This is a very nice place to eat native soup",
168168
})
169169
responseBody := bytes.NewBuffer(postRest)
170-
resp, error := http.Post("http://localhost:1337/restaurants", "application/json", responseBody)
170+
resp, error := http.Post("http://localhost:1337/api/restaurants", "application/json", responseBody)
171171
//Handle Error
172172
if error != nil {
173173
log.Fatalf("An Error Occured %v", error)
@@ -188,7 +188,7 @@ func postD() {
188188
Execute a `PUT` request on the `restaurant` Collection Type in order to update the category of a restaurant.
189189

190190
Be sure that you activated the `update` permission for the `restaurant` Collection Type.
191-
PUT Request is sligtly different as we need to target the particular thing we want update. We do this by first making a request to http://localhost:1337/restaurants/1 and then update what we want to update. In this example, we are going to update "Biscotte Restaurant" to "Restaurant Home".
191+
PUT Request is sligtly different as we need to target the particular thing we want update. We do this by first making a request to http://localhost:1337/api/restaurants/1 and then update what we want to update. In this example, we are going to update "Biscotte Restaurant" to "Restaurant Home".
192192

193193
:::: api-call
194194
::: request Example PUT request
@@ -198,7 +198,7 @@ putRest, _ := json.Marshal(map[string]string {
198198
"name": "Resturant Homes",
199199
})
200200
client := &http.Client{}
201-
url := "http://localhost:1337/restaurants/1"
201+
url := "http://localhost:1337/api/restaurants/1"
202202
req, error := http.NewRequest(http.MethodPut, url, bytes.NewBuffer(putRest))
203203
req.Header.Set("Content-Type", "application/json")
204204
```
@@ -256,7 +256,7 @@ func main() {
256256
}
257257
func getD() {
258258
fmt.Println("Getting data...")
259-
resp, error := http.Get("http://localhost:1337/restaurants")
259+
resp, error := http.Get("http://localhost:1337/api/restaurants")
260260
if error != nil {
261261
fmt.Printf("The HTTP request failed with error %s\n", error)
262262
} else {
@@ -274,7 +274,7 @@ func postD() {
274274
})
275275

276276
responseBody := bytes.NewBuffer(postRest)
277-
resp, error := http.Post("http://localhost:1337/restaurants", "application/json", responseBody)
277+
resp, error := http.Post("http://localhost:1337/api/restaurants", "application/json", responseBody)
278278
// Handle Error
279279
if error != nil {
280280
log.Fatalf("An Error Occured %v", error)
@@ -293,7 +293,7 @@ func putD() {
293293
"name": "Resturant Homes",
294294
})
295295
client := &http.Client{}
296-
url := "http://localhost:1337/restaurants/1"
296+
url := "http://localhost:1337/api/restaurants/1"
297297
req, error := http.NewRequest(http.MethodPut, url, bytes.NewBuffer(putRest))
298298
req.Header.Set("Content-Type", "application/json")
299299
if error != nil {

docs/developer-docs/latest/developer-resources/content-api/integrations/next-js.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/c
88

99
!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!!
1010

11-
This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants).
11+
This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/api/restaurants).
1212

1313
If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Next.js](https://nextjs.org/) remains the same except that you will not fetch the same content.
1414

@@ -67,7 +67,7 @@ Be sure that you activated the `find` permission for the `restaurant` Collection
6767
```js
6868
import axios from 'axios';
6969

70-
axios.get('http://localhost:1337/restaurants').then(response => {
70+
axios.get('http://localhost:1337/api/restaurants').then(response => {
7171
console.log(response);
7272
});
7373
```
@@ -79,7 +79,7 @@ axios.get('http://localhost:1337/restaurants').then(response => {
7979
::: request Example GET request with fetch
8080

8181
```js
82-
fetch('http://localhost:1337/restaurants', {
82+
fetch('http://localhost:1337/api/restaurants', {
8383
method: 'GET',
8484
headers: {
8585
'Content-Type': 'application/json',
@@ -156,7 +156,7 @@ const Home = ({ restaurants, error }) => {
156156

157157
Home.getInitialProps = async ctx => {
158158
try {
159-
const res = await axios.get('http://localhost:1337/restaurants');
159+
const res = await axios.get('http://localhost:1337/api/restaurants');
160160
const restaurants = res.data;
161161
return { restaurants };
162162
} catch (error) {
@@ -205,7 +205,7 @@ Home.getInitialProps = async ctx => {
205205
'Content-Type': 'application/json',
206206
};
207207

208-
const restaurants = await fetch('http://localhost:1337/restaurants', {
208+
const restaurants = await fetch('http://localhost:1337/api/restaurants', {
209209
method: 'GET',
210210
headers,
211211
})
@@ -242,7 +242,7 @@ In this example a `japanese` category has been created which has the id: 3.
242242
import axios from 'axios';
243243

244244
axios
245-
.post('http://localhost:1337/restaurants', {
245+
.post('http://localhost:1337/api/restaurants', {
246246
name: 'Dolemon Sushi',
247247
description: 'Unmissable Japanese Sushi restaurant. The cheese and salmon makis are delicious',
248248
categories: [3],
@@ -258,7 +258,7 @@ axios
258258
:::: tab fetch
259259
::: request Example POST request with fetch
260260
```js
261-
fetch('http://localhost:1337/restaurants', {
261+
fetch('http://localhost:1337/api/restaurants', {
262262
method: 'POST',
263263
headers: {
264264
'Content-Type': 'application/json',
@@ -333,7 +333,7 @@ const Home = ({ allCategories, errorCategories }) => {
333333
e.preventDefault();
334334

335335
try {
336-
const response = await axios.post('http://localhost:1337/restaurants', modifiedData);
336+
const response = await axios.post('http://localhost:1337/api/restaurants', modifiedData);
337337
console.log(response);
338338
} catch (error) {
339339
setErrorRestaurants(error);
@@ -404,7 +404,7 @@ const Home = ({ allCategories, errorCategories }) => {
404404

405405
Home.getInitialProps = async ctx => {
406406
try {
407-
const res = await axios.get('http://localhost:1337/categories');
407+
const res = await axios.get('http://localhost:1337/api/categories');
408408
const allCategories = res.data;
409409
return { allCategories };
410410
} catch (errorCategories) {
@@ -458,7 +458,7 @@ const Home = ({ allCategories, errorCategories }) => {
458458
e.preventDefault();
459459

460460
try {
461-
const response = await fetch('http://localhost:1337/restaurants', {
461+
const response = await fetch('http://localhost:1337/api/restaurants', {
462462
method: 'POST',
463463
headers,
464464
body: JSON.stringify(modifiedData),
@@ -536,7 +536,7 @@ const Home = ({ allCategories, errorCategories }) => {
536536

537537
Home.getInitialProps = async ctx => {
538538
try {
539-
const allCategories = await fetch('http://localhost:1337/categories', {
539+
const allCategories = await fetch('http://localhost:1337/api/categories', {
540540
method: 'GET',
541541
headers,
542542
})
@@ -572,7 +572,7 @@ and the id of your category is `2`.
572572
import axios from 'axios';
573573

574574
axios
575-
.put('http://localhost:1337/restaurants/2', {
575+
.put('http://localhost:1337/api/restaurants/2', {
576576
categories: [2],
577577
})
578578
.then(response => {
@@ -586,7 +586,7 @@ axios
586586
:::: tab fetch
587587
::: request Example PUT request with fetch
588588
```js
589-
fetch('http://localhost:1337/restaurants/2', {
589+
fetch('http://localhost:1337/api/restaurants/2', {
590590
method: 'PUT',
591591
headers: {
592592
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)