Building applications
The back end and APIs
后端与接口
The back end is the part that runs on the server: it receives requests, checks the user's identity and permissions, reads and writes data, then sends back the result.
An API is the contract between front end and back end: it defines which requests are possible and what data is sent and received, usually as JSON.
In REST APIs each operation uses an HTTP verb: GET to read, POST to create, PUT or PATCH to update and DELETE to remove.
An example from this site: when you ask the AI assistant to check your text, the page sends a POST request to /api/assistant; the server checks that you are signed in and within your daily limit, then asks the model and returns the reply.
The most important back-end rule: don't trust what comes from the browser. Every important check, such as permissions, prices and limits, must happen on the server, and secret keys are never sent to the browser.
Ask the AI assistant
Ask anything about this lesson and get a simple answer with the terms in Chinese, Arabic and English.
The AI assistant runs on Google's Gemini model and can make mistakes. Do not write personal information. Available to signed-in learners, up to 30 requests a day.
The content is simplified and covers the basics only.