Commit graph

9 commits

Author SHA1 Message Date
ro11ingbutler
948128ae19
Fix typo (#36592)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-30 18:35:38 +00:00
Sokichi Fujita
7f798c3da0
fix(with-mongodb): Change comment of MongoDB client in getServerSideProps (#35750)
* Change comment of client in getServerSideProps

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-03-31 10:35:54 -05:00
Manny Becerra
36eba95227
Fixes #33153: Updating cross-references from master to main + canary (#33198)
* copy cleanup in env. variables docs

* copy cleanup in fast refresh docs

* Supplements #33153 - updating existing cross-references to `master` branch to renamed default branch of `main`

* Supplements #33153 - updating existing cross-references to `master` branch to renamed default branch of `main`

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-12 02:55:35 +01:00
Kim, Harim
b290a3dc38
Fix with-mongo example by removing deprecated function (#30675)
* Remove deprecated function

* Remove useless change

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-11-30 15:50:50 -06:00
Ado Kukic
220fa9cd14
Update to use the latest MongoDB best practices to limit connection pooling issues. (#28350)
* Update to use the latest MongoDB best practices.

* lint-fix

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-08-25 12:52:12 -05:00
Aryan Beezadhur
f8947b0133
Rename util to lib in with-mongodb example (#27404)
* Rename examples/with-mongodb/util/mongodb.js to examples/with-mongodb/lib/mongodb.js

* Change file import from `util` to `lib`
2021-07-22 11:32:56 -05:00
Luc Leray
8eaabe2fb0
Fix deploy buttons URLs (#20834)
Fix all deploy button URLs in the Next.js repo to follow the following format:
```
https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/<EXAMPLE_NAME>&project-name=<EXAMPLE_NAME>&repository-name=<EXAMPLE_NAME>
```

The detailed docs for the Deploy Button can be found here: https://vercel.com/docs/more/deploy-button.

Also updates legacy Vercel import flow URLs (starting with vercel.com/import or with vercel.com/new/project), to use the new vercel.com/new URLs.

---

For example, for the `hello-world` example:

The URL is https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world

And the deploy button looks like this:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world)

---

For reference, I used the following regexes to search for the incorrect URLs

```
\(https://vercel.com/import/git\?s=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
\(https://vercel.com/import/git\?c=1&s=https://github.com/vercel/next.js/tree/canary/examples/([^&]*)(.*)\)
\(https://vercel.com/import/project\?template=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
https://vercel.com/import/git
https://vercel.com/import/select-scope
https://vercel.com/import
https://vercel.com/new/project
```
2021-01-07 01:40:29 +00:00
Laura Beatris
bad1448478
Style improvements on MongoDB example (#20515)
I've looked at the example code and saw some consistent issues related to code style. The changes applied to this PR fixes the following points:

- Differences of line breaks styles between multiple files
- Differences of if statements styles
- Unnecessary comment
- A typo on a JSDocs

---

There were line breaks between statements on `pages/index.js`
````
export async function getServerSideProps(context) {
  const { client } = await connectToDatabase()

  const isConnected = await client.isConnected() 

  return {
    props: { isConnected },
  }
}
```` 

And this wasn't being applied to the MongoDB utility:

````
export async function connectToDatabase() {
  if (cached.conn) return cached.conn
  if (!cached.promise) {
    const conn = {}
    const opts = {
      useNewUrlParser: true,
      useUnifiedTopology: true,
    }
{...}
````

And also, as shown in the snippet above, there are different styles of if statements being used. 

With that being said, the reason I made this PR is because I think that this kind of inconsistent arises questions when a contributor looks to the codebase, even if this is a simple example.
2020-12-27 16:20:15 +00:00
Ado Kukic
0152dac87f
MongoDB Example (#15029)
* MongoDB Example

* Apply suggestions from code review

* Add changes based on feedback.

* clean up code with more descriptive props

* Use MongoDB in ServerSideProps instead of separate API route

* Update examples/with-mongodb/README.md

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update examples/with-mongodb/README.md

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update examples/with-mongodb/README.md

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update examples/with-mongodb/README.md

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update examples/with-mongodb/README.md

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update examples/with-mongodb/README.md

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update examples/with-mongodb/README.md

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-07-22 20:03:18 -05:00