Shipped
HomeContacts
  • Get started
  • 📚Tutorials
    • Make a waiting list
    • Launch a pre-sale
    • Build a SaaS
    • Create your store on Lemon Squeezy
  • 🟩Features
    • AI Services
    • Affiliate Program
    • Analytics
    • Authentication
      • MailChimp
      • Loops
      • AWS SES
      • SendGrid
      • Supabase Auth
        • Supabase Authentication Flow
        • Supabase Magic Link
        • Supabase Email & Password
        • Supabase Login with Google
    • API endpoints
      • 🛡️Authenticated API
    • Blog
    • Customer support
    • Chrome Extension
    • Dark mode
    • Database
      • Update your database
      • MongoDB
    • Emails
    • Error pages
    • Icons
    • Onboarding
    • Payments
      • Lemon Squeezy
        • Subscriptions
        • One-time purchase
        • Test mode
      • Stripe
    • Private pages
    • SEO
    • shadcn/ui
    • Supabase
    • Workspace / Organizations
  • 📦Components
    • AccountMenu
    • CtaBox
    • DarkModeSwitch
    • Explainer video
    • FAQ
    • Features
    • Footer
    • Header
    • Hero
    • Lifetime
    • Pricing
    • Sales Notification
    • Secondary Sidebar Pages
    • Sidebar
    • Tabs
    • Testimonials
    • Waitlist
    • WebAppPage
  • 🚀Deployment
  • ✅Other
    • Configuration
    • Changelog widget
    • Favicon
    • Google Fonts
    • Sitemap
    • Theme
  • Updates
  • GitHub Repository
  • Support
Powered by GitBook
On this page

Was this helpful?

  1. Features

API endpoints

Shipped uses Next.js 14 latest features, which include the new App Router.

The API endpoints of your product live in the /app/api/ folder. Any route.ts file, and each folder and subfolder, take part to the final endpoint URL.

For example:

/app/api/user/routes.ts -> http://localhost:3000/api/user

/app/api/user/profile/routes.ts -> http://localhost:3000/api/user/profile

/app/api/user/[id]/profile -> http://localhost:3000/api/user/1234/profile

The logic of each route resides in the route.ts files.

Make an API call from your website

To make API calls, use the library axios.


import axios from "axios";
import toast from "react-hot-toast";


axios
  .post("/api/waitlist", {
    email,
  })
  .then(() => {
    toast.success("You've been added to the waitlist!");
  })
  .catch(() => {
    toast.error("Something went wrong. Please try again later.");
  })
  .finally(() => {
    setLoading(false);
  });
PreviousSupabase Login with GoogleNextAuthenticated API

Last updated 1 year ago

Was this helpful?

🟩