Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = {
- ipAddress: "http://localhost:8080"
- }
- var config = require("../../config.js");
- router
- .get('/', function (req, res) {
- var html = `
- <div class="content">
- <a href="${config.ipAddress}/orders">Orders</a>
- <a href="${config.ipAddress}/invoices">Invoices</a>
- </div>
- `
- res.send(html);
- });
- module.exports = router;
- module.exports = {
- ipAddress: "http://255.255.255.255"
- }
- var ipAddress = "http://localhost:8080"; // To be changed into "http://255.255.255.255"
- function placeOrder() {
- fetch(`${ipAddress}/place-order`, {
- method: "POST",
- headers: {
- "Accept": "application/json",
- "Content-type": "application/json"
- }
- })
- .then((res) => res.json())
- .then((data) => xonsole.log(data))
- .catch((err) => console.log(err));
- }
- document.getElementById("submit-order").addEventListener("click", () => placeOrder());
Add Comment
Please, Sign In to add comment