GET
, POST
, PUT
, DELETE
). Additionally, you’ll see how to include client-side components for user authentication and interaction using Nile’s React SDK.
This guide assumes you are running an application similar to
npx create-react-router@latest --template remix-run/react-router-templates/node-postgres
, and have already updated your .env
file from the installation1
Update .env
Update your .env file with
DATABASE_URL
so drizzle works..env
2
Update to node-pg
Update Along with that change, sync up
/server/app.ts
server/app.ts
database/context.ts
to be sure its using the same types, changing from PostgresJsDatabase
, to NodePgDatabase
. In addition, there are may be some compatibility changes that need handled if you are updating an existing project based on our compatibility3
Add Nile to the server
Now we need to add the nile instance and route handlers to allow our server to respond to authentication, user, and tenant requests.Then update your route config to allow the handlers to work
app/routes/api.$.ts
app/routes.ts