restful-api-for-easy-deploy-to-services-like-cyclic
v1.2.0
Published
A fake RESTful API for testing purposes, ready to deploy to services like Cyclic.sh.
Downloads
16
Maintainers
Readme
LICENSE
MIT
RESTful-API
A fake RESTful API for testing purposes,running using the npm module json-server. Ready to deploy to services like Cyclic.sh.
Installation (using any of the two below methods)
Run npm to install RESTful-API:
Method 1: using npm package below
npm i restful-api-for-easy-deploy-to-services-like-cyclic
go to node_modules and you will find a folder with name (restful-api-for-easy-deploy-to-services-like-cyclic)
cut the whole folder and paste the contents in your repo
---(note-> first you have to create your own repo)LICENSE, README.md, db.json and server.js must be there in your repo
if you are not using this package.json then you need to install json-server as dependency in your package.json----> npm i json-server
Method 2: cloning of my repo from github
clone it and the total structure will be at your end. Then do npm install
npm install
Having completed the above process follow the below process:
Now you are ready to deploy to Cyclic.sh:
create your endpoints in db.json
git add .
git commit
git push
Create account in Cyclic
Go to Cyclic.sh
Click on sign up
Click on (Continue with GitHub)
After Successfull Login
- Click on Deploy button
Click on (Link Your Own) tab
In search box type your repo that you created for deployment
If your repo is in private mode---it will show Add a private repo option below----click on it
It will ask for a password confirmation of github
Enter the password of your github account
It will redirect to a page where you have to select Repository access
.Select option called (Only select repositories) --best according to my view.
Then choose the repo from the dropdown
Click on (Appove and install)
Cyclic will start its build and deploying process
After successful build scroll down the page and click on the dashboard button
On dashboard page
Head on to (Environments) tab and click it
In Custom subdomain you can write the name you want and it will create an additional subdomain for you
Initially it takes 1-2 minutes for change of domain
Refresh the page and you will see your custom url
Hurray! you are ready with your deployment now
Now you don't need to worry even you change the data as it will automatically deploy after each commit to that repo
Editing the initial data
The database is in the file db.json. You can edit the JSON information there.
HTTP Requests & Endpoints
Refer to the json-server documentation for how to use your API.