- Set up a Next.js API that connects to a Mongodb collection of geojson map features using SWR and Axios.
- Filter the geojson features with queries and aggregations to create layers on a Mapbox map.
- Use the interactive map and Bootstrap forms to filter, create, update, or delete features in the database.
- Note: this is a work-in-progress...
Import the modules:
npm install
# or
yarn install
Run the development server:
npm run dev
# or
yarn dev
View in your browser:
- http://localhost:3000 - open a page in your browser
- http://localhost:3000/api/features - access that page's endpoint
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
To learn more about Next.js, Mongodb, and Next's API features, take a look at the following resources:
- Next.js documentation - Next.js reference and examples
- Learn Next.js - interactive tutorial
- Learn Mongodb queries and aggregations - Mongodb reference and examples
- Integrating Mongodb and Next.js - interactive tutorial
- Vercel Platform - easily deploy Next.js apps with APIs
- Next.js deployment documentation - Next.js reference and examples