This is a demo on how to utilise API routes in Nextjs applications. This demo was delivered during the CBF fest as part of a technical workshop on "Securing Secret Keys in Frontend Applications"
This is a Next.js project bootstrapped with create-next-app
.
Prerequisites:
-
Clone this repository:
git clone https://github.com/haelmj/fest-workshop-next.git
-
Using a code editor, rename the .env.example file to .env and replace the text on the right side of the equal sign with your API Key.
-
Install the dependencies:
npm install
-
Run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.