Contains any rest apis that I need, and maybe you need too.
View Docs · Report Bug · Request Feature
- Table of Contents
- About the Project
- APIs
- Technologies
- Installation
- Contributing
- Acknowledgements
- Contact
Any Api is a project that contains any rest apis that I need, and maybe you need too. This project is built using Next.js and deployed on Vercel. See the list of APIs below.
-
Clone the repository
# https git clone https://github.com/fauzan-radji/any-api.git # ssh git clone [email protected]:fauzan-radji/any-api.git
-
Copy
.env.local.example
and rename to.env.local
cp .env.local.example .env.local
-
Fill in the environment variables in the
.env.local
fileDB_SEED_KEY=your_seed_key JWT_SECRET=your_jwt_secret SALT_ROUNDS=10 ENVIRONMENT=development
Change
your_seed_key
with your own seed key. You can put literally anything here, but make sure it's a secret because it will be used to seed the database via the API. If you have better suggestions for this, please let me know. TheJWT_SECRET
is used to sign the JWT token. TheSALT_ROUNDS
is used to hash the password. TheENVIRONMENT
is used to determine the environment of the app change it toproduction
when deploying to production. -
If you deploy this to vercel, you need to set the
JSON_MODELIZER_DATAPATH
to/tmp/data
since vercel doesn't allow writing to the filesystem.JSON_MODELIZER_DATAPATH=/tmp/data
-
Install the dependencies
cd any-api npm install
-
Run the development server
npm run dev
-
Create a
POST
request tohttp://localhost:3000/seed
with the following body to seed the database. Changeyour_seed_key
with the seed key you set in the.env.local
file. If you have better suggestions for this, please let me know.{ "key": "your_seed_key" }
-
Open http://localhost:3000 with your browser to see the result.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag enhancement
.
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch
git checkout -b feature/AmazingFeature
- Commit your Changes
git commit -m 'Add some AmazingFeature'
- Push to the Branch
git push origin feature/AmazingFeature
- Open a Pull Request
Fauzan Radji - LinkedIn
Project Link: https://any-api.vercel.app