isi repositori ini adalah bentuk kemandirian agar tidak bergantung kepada forlap dikti
A simple API server built with Express.js and Axios.
These instructions will help you set up and run the project on your local machine.
Make sure you have Node.js and npm installed on your machine.
Start the server with the following command:
node server.js
The server will run on vercel https://hasil-studi-mj.vercel.app/
.
Fetches data from an external API and returns it in JSON format.
Request:
GET /api/data
Response:
{
// JSON data from external API
}
To fetch and display the data from the API in a web page, you can use the following JavaScript code. This code fetches the data from the API and populates the HTML elements with the corresponding data.
https://mjmokhtar.netlify.app/hasil-studi
The server is configured to allow Cross-Origin Resource Sharing (CORS) for all origins. The following headers are set:
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
If there is an error while fetching data from the external API, the server responds with a status code 500 and a message 'Error fetching data'.
- express: Fast, unopinionated, minimalist web framework for Node.js.
- axios: Promise based HTTP client for the browser and Node.js.
This project is licensed under the MIT License - see the LICENSE file for details.