Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary How not to connect with a database (ReactJS)

Rating
-
Sold
-
Pages
1
Uploaded on
22-02-2023
Written in
2021/2022

In this document, I have described how not to connect with a database from inside a React App.

Institution
Course

Content preview

SENDING HTTP REQUESTS (CONNECTING TO A DATABASE)
How not to connect with a database:
 Do not write code to connect with a database in your React App. This is because the
corresponding code is visible in the browser (under Sources tab in the developer
tools), and anyone can steal your database credentials from there.
 Instead, the code to connect with a database is written on another backend app that
is placed (or deployed) on another server and it receives http requests from the
React App to then return the corresponding response to it.
 Type script code is also compiled to JavaScript code which is then understood by the
browser
 You should never add confidential information such as passwords, usernames,
email-addresses, database queries and database credentials into your frontend
code.
 You can however add API keys as long as you want people to access them publicly. If
you do not want people to access them publicly, then you’ll have to restrict access to
your API using some mechanism, e.g. IP whitelisting or some other logic.
 You cannot hide your front-end logic from users but that also might not be a big
problem as the production code is minified and hard to read; this is because the
variable names are shortened and there are no whitespaces too. Also, most of the
core business logic is usually present on the server side.

Written for

Course

Document information

Uploaded on
February 22, 2023
Number of pages
1
Written in
2021/2022
Type
SUMMARY

Subjects

$20.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
hafsasaleem224

Get to know the seller

Seller avatar
hafsasaleem224 Academind
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions