Create an endpoint with a POST request to an API, store the response that includes credentials, then store data inside created API endpoint and send a GET request to see the stored data in UI.
MIT License
Project basically allows you to create an API endpoint called with a post request an returns the corresponding gameID with 1-createGameWithPostRequest.js
node.js.
Then you can fill the corresponding game with either 2-fillGamePostRequest.js
node.js or you can update the score from user interface.
Refresh button allows you to send a get request to the API that you created.
Submit button allows you to send a post request that will add the name and score features to created API endpoint in json data format.
npm install
--> For uploading all the necessary packages.
or
npm init
--> Start with initializing package.json
npm install webpack webpack-cli webpack-dev-server html-webpack-plugin style-loader css-loader --save-dev
--> Install Webpack packages
Create a src folder so that webpack can compile source codes (Do not forget to add import "./style.css";
inside your main js file)
Create webpack-config.js
webpack config file and fill it.
Add "build": "webpack", "watch": "webpack --watch", "start": "webpack serve --open"
inside package.json scripts.
npm install luxon --save-dev
--> date package
npm install fs node-fetch dotenv
--> packages for maintaining environment variables, writing them on respective files and running script functions inside script folder as node.js
npm run build
npm start
npm install [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] --save-dev
configure .hintrc
configure .styleintrc.json
configure .eslintrc.json
npx hint .
npx stylelint "**/*.{css,scss}"
npx eslint .
npm install node-fetch dotenv fs
Add "type": "module"
inside package.json
Run scripts/1-createGameWithPostRequest.js
to create a Game inside the API.
Then read the gameID from gameIdConfig.json
and create and fill the gameIdConfig.js
so that it can export the gameID inside index.html
.
Run scripts/2-fillGamePostRequest.js
to add inputs on the created game API endpoint.
Run scripts/3-getCreatedGameData.js
to read the data entered inside created game API endpoint.
HTML
CSS
JavaScript
webpack
luxon
dotenv
fs
node-fetch
👤 Mert Kaya
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.