mirror of
https://github.com/strapi/strapi.git
synced 2026-01-04 03:03:38 +00:00
Fix database link and example (#6350)
* Fix database link and example Hey guys, I was just looking the documentation and found out that this URL is going to the old path, this will point to the new one. And since the configuration now it's a bit different, I changed to represent the new block code as well. Signed-off-by: Willian Justen de Vasconcellos <willianjustenqui@gmail.com> * Update README.md * Update README.md Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
This commit is contained in:
parent
2dbef5959a
commit
1cad652588
@ -34,33 +34,31 @@ docker-compose -f docker-compose.dev.yml stop
|
||||
DB={dbName} yarn develop
|
||||
```
|
||||
|
||||
The way it works is that the `getstarted` app has a specific `database.js` config file that will use the `DB` environment variable to setup the right database connection. You can look at the code [here](./config/environments/development/database.js)
|
||||
The way it works is that the `getstarted` app has a specific `database.js` config file that will use the `DB` environment variable to setup the right database connection. You can look at the code [here](./config/database.js)
|
||||
|
||||
**Warning**
|
||||
|
||||
You might have some errors while connecting to the databases.
|
||||
They might be coming from a conflict between a locally running database instance and the docker instance. To avoid the errors either shutdown your local database instance or change the ports in the `./config/environments/development/database.js` and the `docker-compose.dev.yml` file.
|
||||
They might be coming from a conflict between a locally running database instance and the docker instance. To avoid the errors either shutdown your local database instance or change the ports in the `./config/database.js` and the `docker-compose.dev.yml` file.
|
||||
|
||||
**Example**:
|
||||
|
||||
`database.js`
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
connections: {
|
||||
default: {
|
||||
connector: 'mongoose',
|
||||
settings: {
|
||||
// host: 'localhost',
|
||||
// database: 'strapi',
|
||||
// username: 'root',
|
||||
// password: 'strapi',
|
||||
port: 27099,
|
||||
},
|
||||
options: {},
|
||||
},
|
||||
const mongo = {
|
||||
connector: 'mongoose',
|
||||
settings: {
|
||||
database: 'strapi',
|
||||
username: 'root',
|
||||
password: 'strapi',
|
||||
port: 27099,
|
||||
host: 'localhost',
|
||||
},
|
||||
options: {},
|
||||
};
|
||||
|
||||
module.exports = mongo;
|
||||
```
|
||||
|
||||
`docker-compose.dev.yml`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user