This is Odd OrEven application ran by Appwrite cloud function., on Appwrite platform.
Currently working demo: On this link
This project is a simple URL Shortener service.
It contains a form with URL and Alias inputs.
In URL input you add your URL you want shorten.
In Alias input you write something with what will you recognize what Short URL represents. It is only arbitrary.
It contains a button that can fetch your Short URLs from a database into the table on the same page.
This project contains services:
- Preview of UI form and number checker
- It will rickroll you if you send invalid value 3 times in a row
- Fork this repository
- Clone it locally
- Change project ID inisde appwrite.json file to your project ID.
- While in root folder, run appwrite cli command
appwrite deploy functionand follow steps to deploy it -
- If you don't have appwrite cli installed, check this link and install it on your device
This project is developed with:
- Typescript
- appwrite-node
- HTML, CSS and JS for template
Refer to Package JSON file
- Locally, go to
functions/is-odd-or-evenpath. - Run
npm installcommand - Start coding
NOTE: Make code adjustments only inside dev folder. Code inside dev folder will be built into src folder.
- While inside
functions/is-odd-or-evenpath, runnom run buildcommand after you made your desired code changes - Go back to the root folder and run
appwrite deploy functioncommand. Follow the steps to deploy your function. - If needed, refer back to Manual Setup section
- GET -
/- Shows a static generator template - post -
/: -
- Checks if value is a number, and if it is odd or even
-
- Allows POST method only
-
- Must have
'Content-Type': 'application/json'header
- Must have
-
- Allowed payload example:
JSON.stringify({
number: NUMBER VALUE,
})
Refer to the template to see how it is used in the simple frontend.
