Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shaaanuu/node-hosting-test
https://github.com/shaaanuu/node-hosting-test
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/shaaanuu/node-hosting-test
- Owner: shaaanuu
- Created: 2024-11-15T10:50:20.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-15T11:27:43.000Z (about 1 month ago)
- Last Synced: 2024-11-15T12:17:35.851Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://node-hosting-test.vercel.app
- Size: 688 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node Hosting Testing 🚀
This is a simple Node.js project that serves as an API to provide information about planets 🌍 in our solar system. The API is hosted and deployed using [Vercel](https://vercel.com). 🌐
## API Endpoints 🛸
### `GET /api/planets` 🌌
Returns a list of all planets in our solar system with detailed information.
#### Example Response:
```json
[
{
"id": 1,
"name": "Mercury",
"type": "Rocky",
"diameter": 4879,
"distanceFromSun": 57910000,
"moons": 0,
"description": "The smallest planet in our solar system, closest to the Sun. ☀️"
},
]
```### `GET /api/planets/:id` 🌠
Returns information about a specific planet by its ID.
#### Example Response (for `GET /api/planets/1`):
```json
{
"id": 1,
"name": "Mercury",
"type": "Rocky",
"diameter": 4879,
"distanceFromSun": 57910000,
"moons": 0,
"description": "The smallest planet in our solar system, closest to the Sun. ☀️"
}
```#### Error Response (if planet is not found):
```json
{
"message": "Planet not found 😞"
}
```## Setup and Installation 🛠️
To run this project locally:
1. Clone the repository:
```bash
git clone https://github.com/shaaanuu/node-hosting-test.git
```2. Navigate to the project directory:
```bash
cd node-hosting-testing
```3. Install dependencies:
```bash
npm install
```4. Start the local server:
```bash
node api/index.js
```The app will run on `http://localhost:3000`. 🌍
## Deployment 🚀
This project is deployed on [Vercel](https://vercel.com). Every time you push code to the repository, Vercel automatically redeploys the project with the latest changes.
## License 📄
This project is open-source and available under the [MIT License](LICENSE).