Hi team, i am getting 404 in auth/signup api, i ha...
# support-questions-legacy
k
Hi team, i am getting 404 in auth/signup api, i have setup the frontend in react and backend in fastapi. can anyone please help here? Database in postgres.
n
Hi @kamyab, Can you enable debug logs and share the output? (The documentation has a troubleshooting guide that explains how to do this)
k
Copy code
import React from "react";

import SuperTokens, {
  getSuperTokensRoutesForReactRouterDom,
  SuperTokensWrapper,
} from "supertokens-auth-react";
import * as reactRouterDom from "react-router-dom";
import EmailPassword from "supertokens-auth-react/recipe/emailpassword";
import Session from "supertokens-auth-react/recipe/session";
import { BrowserRouter, Routes, Route, Link } from "react-router-dom";

import logo from "./logo.svg";
import "./App.css";

import axios from "axios";

SuperTokens.init({
  appInfo: {
    // learn more about this on https://supertokens.com/docs/emailpassword/appinfo
    appName: "Supertokens",
    apiDomain: "http://localhost:3001",
    websiteDomain: "http://localhost:3000",
    apiBasePath: "/auth",
    websiteBasePath: "/auth",
  },
  recipeList: [EmailPassword.init(), Session.init()],
});

Session.addAxiosInterceptors(axios);


function App() {
  return (
    <SuperTokensWrapper>
      <BrowserRouter>
        <Routes>
          {/*This renders the login UI on the /auth route*/}
          {getSuperTokensRoutesForReactRouterDom(reactRouterDom)}
          {/*Your app routes*/}
        </Routes>
      </BrowserRouter>
    </SuperTokensWrapper>
  );
}

export default App;
this is simple react code
and login page is appering
For backend https://github.com/supertokens/supertokens-python/tree/master/examples/with-fastapi/with-thirdpartyemailpassword and i am using poerty instade of pip, that's the only one diffrence
n
The example you are following uses the thirdpartyemailpassword for Python but the React code you sent is using emailpassword
k
this are the error message
n
If you like you can use
npx create-supertokens-app
to see what the code should be for your tech stack
k
Sure let me check
Thanks for quich replay
let me check is there any thing will let you know here
n
Happy to help, let is know if you face any issues when setting it up
k
is it possible to add /signup and sign in api endpoints in my swagger? currenlty it is coming from the middle where and it is not displaying in swagger
it dosen’t have fastapi code
n
Right, refer to https://supertokens.com/docs/emailpassword/quick-setup/backend. You can select python and fastapi to see the snippet you need to use
k
Yes got it
??
n
hmm im not too familiar with how that setup works, does your Swagger docs make network requests to your server (which uses SuperTokens)?
Or is your question about how you can autogenerate Swagger while using the middleware APIs?
k
yes it is my question
n
So Swagger lets you use the inspector to generate specs by actually making network requests
You can call the APIs you want to include in the spec and generate one that way
Unfortunately Swagger wont be able to simply scan all the middleware routes so theres no one click way of doing it
k
ok let me check
Thanks for your help
317 Views