Demo polls application created using PollsAPI built on NextJS
Project uses Environment variable - API_KEY To add it please add
.env.local
file at the root level and add followingAPI_KEY=<API Key from PollsAPI>
This application is built using PollsAPI so to start off with it you would need to get the API Key for PollsAPI
PollsAPI has a Free tier which you can use to get started.
- Login to PollsAPI - https://www.pollsapi.com/login
- Once logged in grab your API Key from the Dashboard
- Add the key as an
Environment Variable
by creating a.env.local
file at the root level.
For SEO and link sharing, you can configure your Site's URL, Title, Description & Image attributes. You can configure the SEO by updating the file - site.config.js.
Once setup with the repo locally and having the .env.local
file added, you are all set to go ahead with our local setup.
Run:
# yarn
$ yarn
$ yarn dev
# npm
$ npm install
$ npm run dev
This is install all the dependencies and start a local development server running on port 3000
so you can access it on https://localhost:3000
Since NextJS enables the SSR debugging is really easy. Stop your server, if already running, and then start it by
# yarn
$ yarn debug
# npm
$ npm run debug
This will run the server with debugging available on port 9570
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.
For SEO, we have used next-seo
and created a basic config for SEO.
Learn more about how to config next-seo
- https://github.com/garmeeh/next-seo#usage
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.