Link to home
Start Free TrialLog in
Avatar of mikha
mikhaFlag for United States of America

asked on

working with next js , server side rendering

I am new to react , next  js programming. through some tutorials I have created a boiler plate, server side rendering app, which has a following project structure.


nextApp
> .next
> node_nodules
> pages
    > api
        > app.js
> public
> src
   > views
       > layout.tsx
>.babelrc
>next-env.d.ts
>next.config.js
>package-lock.json
>package.json
>readme.md

now I want to create endpoints that talks to a database ( mysql preferebably) that the front end code can call.
how do I go about this. what are the libraries I need to create api and talk to the mysql database.

does anyone have a tutorial for this, and in the folder structure above, where should i start adding code/files for my api endpoints and how would the code that talks to the database be. ?
Avatar of leakim971
leakim971
Flag of Guadeloupe image

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.