Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Reza Indra rezaindrag

🎯
Focusing
View GitHub Profile
@rezaindrag
rezaindrag / app.js
Created Jun 16, 2020
Implementation
View app.js
const request = require("request");
const getStream = require("get-stream");
const API_KEY = "your-api-key";
function authorize(authorization) {
if (authorization !== API_KEY) {
throw new Error("Your API key is invalid or incorrect.");
}
}
@rezaindrag
rezaindrag / server.js
Created Jun 16, 2020
Initiate Server
View server.js
const express = require("express");
const fs = require("fs");
const app = require("./app");
const server = express();
// Load file config.json
const file = fs.readFileSync("./config.json");
const config = JSON.parse(file);