Publish to my blog (weekly)

    • throw Error): HttpError (+1 overload)
import error">error(404, {
      Error.message: string">message: 'Not found'
      });
    • unlike normal directories, (app) and (marketing) do not affect the URL pathname of the routes inside them:
    • ?/registe
    • /login?/register
    • action="?/login"
    • <button formaction="?/register">Register</button
    • RequestEvent&lt;{}, string | null>) => Promise&lt;{&#10; success: boolean;&#10;}>">login: async ({ Cookies">cookies, request }) => {
    • RequestEvent&lt;{}, string | null>) => Promise&lt;void>">register: async (RequestEvent&lt;{}, string | null>">event) => {
    • This means that your page's load functions will run after the action completes.
    • Note that handle runs before the action is invoked, and does not re-run before the load functions.
    • To define an option for the whole app, export it from the root layout.
    • you always include a file extension
    • src/routes/foo.json/+server.js and src/routes/foo/bar.json/+server.js
    • If your load function should always run on the server (because it uses private environment variables, for example, or accesses a database) then you can put it in a +page.server.js instead.
    • shared
    • server-only
    • a filesystem-based router
    • which can be identified by their + prefix.
    • A +page.svelte component defines a page of your app
    • a href="/about">About my site</a>
    • <a href="/">Home</a>
    • Often, a page will need to load some data before it can be rendered.
    • export const load: Load&lt;{&#10; slug: string;&#10;}, Record&lt;string, any> | null, Record&lt;string, any>, void | Record&lt;string, any>, string | null>&#10;import PageLoad">PageLoad
    • params.slug
    • return {
      title: 'Hello world!',
      content: 'Welcome to our blog. Lorem ipsum dolor sit amet...'
      };
    • If your effect returns a function, React will run it when it is time to clean up:

Posted from Diigo. The rest of my favorite links are here.

댓글

이 블로그의 인기 게시물

Publish to my blog (weekly)

Publish to my blog (weekly)