├── .env.sample ├── .gitignore ├── Procfile ├── README.md ├── config.json ├── index.js ├── package-lock.json └── package.json /.env.sample: -------------------------------------------------------------------------------- 1 | SECRET_KEY=YOUR_API_KEY -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | node_modules/ -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node index.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Whitelist_API 2 | 3 | 4 | ## This repo is meant to be used with https://github.com/CryptoOutcasts/Candy_Machine_Whitelist_Site 5 | ## after youre done with this repo and finalizing your API , you may proceed to Candy_Machine_Whitelist_Site 6 | This project is only experimental, use carefully. Im not responsible for any fatal errors for any project. 7 | Always use on testnet before using on mainnet 8 | This project works offchain and does not validate whitelisted users using on chain data ! 9 | This repo is intended to be used with Candy Machine Mint site, or with my repo Candy_Machine_Whitelist_Site 10 | 11 | 12 | ## How to run: 13 | Clone the repo (obviously) 14 | 15 | ### 1) Add your own environmental variables (.env) 16 | ``` 17 | SECRET_KEY=__MY_KEY__ 18 | ``` 19 | Your API authentication key used to prevent someone else from accessing the api and updating whitelisted users 20 | #### after you are done rename ".env.sample" to ".env" 21 | 22 | 23 | ### 2) create a csv containing the list of whitelisted users and reserves for each user 24 | 25 | #### REQUIREMENTS FOR CSV FILE: 26 | 1) Must be comma delimted 27 | 2) Must have two Columns: 1)member 2)reserve , Its important to name the two columns exactly like this 28 | ![example](https://i.imgur.com/PnJaoj2.png) 29 | ``` 30 | each row has a member which is the address of the user you wish to whitelist, reserve is how many nfts can they this address mint 31 | ``` 32 | 3) Must be named whitelisted.csv 33 | 4) Must be in the main directory, do not put in a seperate file called assets or similar. 34 | 35 | 36 | ### 3) Edit the config.json to your needs 37 | #### To reload the csv list everytime the script runs 38 | ```set load_csv_onetime = false``` 39 | #### If you wish to run the script once and not have it run everytime 40 | ``` 41 | set load_csv_one time = true 42 | and loaded = false 43 | ``` 44 | 45 | 46 | 47 | ### 4) Upload to a hosting server, we recommend heroku. if you decide to use heroku here are the steps to setting that up: 48 | if you prefer tutorials, this one is good and features two options: https://www.youtube.com/watch?v=Rz886HkV1j4&t=733s 49 | #### IMPORTANT: MAKE SURE TO FOLLOW THE STEPS FOR ADDING .ENV TO THE HOSTING SYSTEM (included in the video) 50 | #### ALL COMMANDS SHOULD BE RAN IN THE MAIN DIRECTORY 51 | Install the heroku CLI: https://devcenter.heroku.com/articles/heroku-cli 52 | #### ITS IMPORTANT THAT YOU SAVE ALL THE FILES YOU EDITED INORDER FOR GIT TO RECOGNIZE CHANGES 53 | 1. run: ```heroku login``` , and then login into your account. 54 | 2. run ```git init``` 55 | 3. run ```heroku create Your_Project_Name``` heroku will then supply you with two urls, one of which is the url of the API, the other is not important (the one with github in it) 56 | 4. run ```git add .``` 57 | 5. run ```git commit -m "first-commit``` 58 | 6. run ```git branch -M master``` 59 | 7. run ```git push heroku master``` 60 | 8. after that is done run ```heroku config:set SECRET_KEY=Your_API_Key``` 61 | #### Your_API_Key stands for the key you put in the env file in step 2 62 | 63 | Congratulations 🍰, you have now deployed your API online. 64 | #### to make sure everyting is working great: 65 | Grab the heroku url, or the url you hosted your api on. and then add /whitelisted to it 66 | ``` 67 | https://myherokyapp.herokuapp.com/whitelisted 68 | ``` 69 | You should see a list of your whitelisted members that you included in the csv file 70 | great that means your api is working. 71 | #### Grab the api key and heroku url and then integrate this with https://github.com/CryptoOutcasts/Candy_Machine_Whitelist_Site 72 | 73 | 74 | 75 | If you need anything you can contact me on Crypto Outcasts discord server: 76 | https://discord.gg/KTVYs7QAfP 77 | 78 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | {"load_csv_onetime":true,"loaded":true} -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const exp = require("express"); 2 | const app = exp(); 3 | const fs = require("fs") 4 | const { exit } = require("process"); 5 | const cors=require("cors"); 6 | require('dotenv').config() 7 | 8 | app.use(exp.json()); 9 | const corsOptions ={ 10 | origin:'*', 11 | credentials:true, 12 | optionSuccessStatus:200, 13 | } 14 | app.use(cors(corsOptions)) 15 | 16 | 17 | let csvToJson = require('convert-csv-to-json'); 18 | 19 | let rawdata = fs.readFileSync('config.json'); 20 | let config = JSON.parse(rawdata); 21 | 22 | 23 | if (!fs.existsSync('./whitelisted.csv')) { 24 | console.log("ERROR: No whitelisted.csv file has been found") 25 | exit(1) 26 | } 27 | if(!fs.existsSync('./whitelisted.json')){ 28 | csvToJson.fieldDelimiter(',') 29 | csvToJson.generateJsonFileFromCsv("whitelisted.csv", "whitelisted.json") 30 | config.loaded = true; 31 | console.log("No whitelisted.json detected, converting csv to json") 32 | } 33 | if(!config.load_csv_onetime){ 34 | csvToJson.fieldDelimiter(',') 35 | csvToJson.generateJsonFileFromCsv("whitelisted.csv", "whitelisted.json") 36 | console.log("Json reloaded: config is set csv_run_onetime = false") 37 | } 38 | else{ 39 | console.log("Skipping csv reload, config is set csv_run_onetime = true") 40 | if(!config.loaded){ 41 | config.loaded = true 42 | fs.writeFile('config.json', JSON.stringify(config), 'utf8', (err) =>{ if(err) console.log(err)}); 43 | csvToJson.fieldDelimiter(",") 44 | csvToJson.generateJsonFileFromCsv("whitelisted.csv","whitelisted.json") 45 | console.log("Data reloaded due to config loaded = false") 46 | } 47 | } 48 | 49 | 50 | 51 | 52 | app.get('/whitelisted', (req, res)=>{ 53 | let rawdata = fs.readFileSync('whitelisted.json'); 54 | let members = JSON.parse(rawdata); 55 | res.send(members) 56 | }) 57 | 58 | app.get('/whitelisted/member/:address', (req, res, value) => { 59 | let sent = false; 60 | let rawdata = fs.readFileSync('whitelisted.json'); 61 | let members = JSON.parse(rawdata); 62 | const user = members.find(c => c.member == req.params.address) 63 | if(!user){ 64 | res.status(404).send("the member was not found"); 65 | } 66 | res.send(user); 67 | }) 68 | 69 | app.put('/whitelisted/update/:address/:secret', (req, res) => { 70 | if(req.params.secret != process.env.SECRET_KEY){ 71 | res.status(404).send("Invalid Auth Key") 72 | return 73 | } 74 | let index = 0; 75 | let result = {} 76 | let rawdata = fs.readFileSync('whitelisted.json'); 77 | let members = JSON.parse(rawdata); 78 | members.forEach((whitelisted_user, i) => { 79 | if(whitelisted_user.member == req.params.address){ 80 | result = whitelisted_user 81 | index = i; 82 | } 83 | }); 84 | if(result == {}){ 85 | res.status(404).send("User does not exist") 86 | return 87 | } 88 | result.reserve = req.body.reserve 89 | members[index] = result; 90 | const data = JSON.stringify(members); 91 | fs.writeFile('whitelisted.json', data, 'utf8', (err) =>{ if(err) console.log(err)}); 92 | res.send(result) 93 | 94 | }) 95 | const port = process.env.PORT || 3000 96 | app.listen(port, ()=>console.log(`listening on port ${port}`)); -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ExpressAPI", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.7", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 10 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 11 | "requires": { 12 | "mime-types": "~2.1.24", 13 | "negotiator": "0.6.2" 14 | } 15 | }, 16 | "array-flatten": { 17 | "version": "1.1.1", 18 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 19 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 20 | }, 21 | "body-parser": { 22 | "version": "1.19.0", 23 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 24 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 25 | "requires": { 26 | "bytes": "3.1.0", 27 | "content-type": "~1.0.4", 28 | "debug": "2.6.9", 29 | "depd": "~1.1.2", 30 | "http-errors": "1.7.2", 31 | "iconv-lite": "0.4.24", 32 | "on-finished": "~2.3.0", 33 | "qs": "6.7.0", 34 | "raw-body": "2.4.0", 35 | "type-is": "~1.6.17" 36 | } 37 | }, 38 | "bytes": { 39 | "version": "3.1.0", 40 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 41 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 42 | }, 43 | "content-disposition": { 44 | "version": "0.5.3", 45 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 46 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 47 | "requires": { 48 | "safe-buffer": "5.1.2" 49 | } 50 | }, 51 | "content-type": { 52 | "version": "1.0.4", 53 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 54 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 55 | }, 56 | "convert-csv-to-json": { 57 | "version": "1.3.1", 58 | "resolved": "https://registry.npmjs.org/convert-csv-to-json/-/convert-csv-to-json-1.3.1.tgz", 59 | "integrity": "sha512-cKugcLmLHIdgxk1zSiq9ImPMszskp4zR3uJi8Ty9qx2/QhCozPVTk8A9v3b9ZEYnkbY6fbk7jEKyJzQZ49/p7A==" 60 | }, 61 | "cookie": { 62 | "version": "0.4.0", 63 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 64 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 65 | }, 66 | "cookie-signature": { 67 | "version": "1.0.6", 68 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 69 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 70 | }, 71 | "cors": { 72 | "version": "2.8.5", 73 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 74 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 75 | "requires": { 76 | "object-assign": "^4", 77 | "vary": "^1" 78 | } 79 | }, 80 | "debug": { 81 | "version": "2.6.9", 82 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 83 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 84 | "requires": { 85 | "ms": "2.0.0" 86 | } 87 | }, 88 | "depd": { 89 | "version": "1.1.2", 90 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 91 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 92 | }, 93 | "destroy": { 94 | "version": "1.0.4", 95 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 96 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 97 | }, 98 | "dotenv": { 99 | "version": "10.0.0", 100 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", 101 | "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" 102 | }, 103 | "ee-first": { 104 | "version": "1.1.1", 105 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 106 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 107 | }, 108 | "encodeurl": { 109 | "version": "1.0.2", 110 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 111 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 112 | }, 113 | "escape-html": { 114 | "version": "1.0.3", 115 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 116 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 117 | }, 118 | "etag": { 119 | "version": "1.8.1", 120 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 121 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 122 | }, 123 | "express": { 124 | "version": "4.17.1", 125 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 126 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 127 | "requires": { 128 | "accepts": "~1.3.7", 129 | "array-flatten": "1.1.1", 130 | "body-parser": "1.19.0", 131 | "content-disposition": "0.5.3", 132 | "content-type": "~1.0.4", 133 | "cookie": "0.4.0", 134 | "cookie-signature": "1.0.6", 135 | "debug": "2.6.9", 136 | "depd": "~1.1.2", 137 | "encodeurl": "~1.0.2", 138 | "escape-html": "~1.0.3", 139 | "etag": "~1.8.1", 140 | "finalhandler": "~1.1.2", 141 | "fresh": "0.5.2", 142 | "merge-descriptors": "1.0.1", 143 | "methods": "~1.1.2", 144 | "on-finished": "~2.3.0", 145 | "parseurl": "~1.3.3", 146 | "path-to-regexp": "0.1.7", 147 | "proxy-addr": "~2.0.5", 148 | "qs": "6.7.0", 149 | "range-parser": "~1.2.1", 150 | "safe-buffer": "5.1.2", 151 | "send": "0.17.1", 152 | "serve-static": "1.14.1", 153 | "setprototypeof": "1.1.1", 154 | "statuses": "~1.5.0", 155 | "type-is": "~1.6.18", 156 | "utils-merge": "1.0.1", 157 | "vary": "~1.1.2" 158 | } 159 | }, 160 | "finalhandler": { 161 | "version": "1.1.2", 162 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 163 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 164 | "requires": { 165 | "debug": "2.6.9", 166 | "encodeurl": "~1.0.2", 167 | "escape-html": "~1.0.3", 168 | "on-finished": "~2.3.0", 169 | "parseurl": "~1.3.3", 170 | "statuses": "~1.5.0", 171 | "unpipe": "~1.0.0" 172 | } 173 | }, 174 | "forwarded": { 175 | "version": "0.2.0", 176 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 177 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" 178 | }, 179 | "fresh": { 180 | "version": "0.5.2", 181 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 182 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 183 | }, 184 | "http-errors": { 185 | "version": "1.7.2", 186 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 187 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 188 | "requires": { 189 | "depd": "~1.1.2", 190 | "inherits": "2.0.3", 191 | "setprototypeof": "1.1.1", 192 | "statuses": ">= 1.5.0 < 2", 193 | "toidentifier": "1.0.0" 194 | } 195 | }, 196 | "iconv-lite": { 197 | "version": "0.4.24", 198 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 199 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 200 | "requires": { 201 | "safer-buffer": ">= 2.1.2 < 3" 202 | } 203 | }, 204 | "inherits": { 205 | "version": "2.0.3", 206 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 207 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 208 | }, 209 | "ipaddr.js": { 210 | "version": "1.9.1", 211 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 212 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" 213 | }, 214 | "media-typer": { 215 | "version": "0.3.0", 216 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 217 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 218 | }, 219 | "merge-descriptors": { 220 | "version": "1.0.1", 221 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 222 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 223 | }, 224 | "methods": { 225 | "version": "1.1.2", 226 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 227 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 228 | }, 229 | "mime": { 230 | "version": "1.6.0", 231 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 232 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 233 | }, 234 | "mime-db": { 235 | "version": "1.50.0", 236 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", 237 | "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==" 238 | }, 239 | "mime-types": { 240 | "version": "2.1.33", 241 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", 242 | "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", 243 | "requires": { 244 | "mime-db": "1.50.0" 245 | } 246 | }, 247 | "ms": { 248 | "version": "2.0.0", 249 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 250 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 251 | }, 252 | "negotiator": { 253 | "version": "0.6.2", 254 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 255 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 256 | }, 257 | "object-assign": { 258 | "version": "4.1.1", 259 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 260 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 261 | }, 262 | "on-finished": { 263 | "version": "2.3.0", 264 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 265 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 266 | "requires": { 267 | "ee-first": "1.1.1" 268 | } 269 | }, 270 | "parseurl": { 271 | "version": "1.3.3", 272 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 273 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 274 | }, 275 | "path-to-regexp": { 276 | "version": "0.1.7", 277 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 278 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 279 | }, 280 | "proxy-addr": { 281 | "version": "2.0.7", 282 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 283 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 284 | "requires": { 285 | "forwarded": "0.2.0", 286 | "ipaddr.js": "1.9.1" 287 | } 288 | }, 289 | "qs": { 290 | "version": "6.7.0", 291 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 292 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 293 | }, 294 | "range-parser": { 295 | "version": "1.2.1", 296 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 297 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 298 | }, 299 | "raw-body": { 300 | "version": "2.4.0", 301 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 302 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 303 | "requires": { 304 | "bytes": "3.1.0", 305 | "http-errors": "1.7.2", 306 | "iconv-lite": "0.4.24", 307 | "unpipe": "1.0.0" 308 | } 309 | }, 310 | "safe-buffer": { 311 | "version": "5.1.2", 312 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 313 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 314 | }, 315 | "safer-buffer": { 316 | "version": "2.1.2", 317 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 318 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 319 | }, 320 | "send": { 321 | "version": "0.17.1", 322 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 323 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 324 | "requires": { 325 | "debug": "2.6.9", 326 | "depd": "~1.1.2", 327 | "destroy": "~1.0.4", 328 | "encodeurl": "~1.0.2", 329 | "escape-html": "~1.0.3", 330 | "etag": "~1.8.1", 331 | "fresh": "0.5.2", 332 | "http-errors": "~1.7.2", 333 | "mime": "1.6.0", 334 | "ms": "2.1.1", 335 | "on-finished": "~2.3.0", 336 | "range-parser": "~1.2.1", 337 | "statuses": "~1.5.0" 338 | }, 339 | "dependencies": { 340 | "ms": { 341 | "version": "2.1.1", 342 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 343 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 344 | } 345 | } 346 | }, 347 | "serve-static": { 348 | "version": "1.14.1", 349 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 350 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 351 | "requires": { 352 | "encodeurl": "~1.0.2", 353 | "escape-html": "~1.0.3", 354 | "parseurl": "~1.3.3", 355 | "send": "0.17.1" 356 | } 357 | }, 358 | "setprototypeof": { 359 | "version": "1.1.1", 360 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 361 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 362 | }, 363 | "statuses": { 364 | "version": "1.5.0", 365 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 366 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 367 | }, 368 | "toidentifier": { 369 | "version": "1.0.0", 370 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 371 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 372 | }, 373 | "type-is": { 374 | "version": "1.6.18", 375 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 376 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 377 | "requires": { 378 | "media-typer": "0.3.0", 379 | "mime-types": "~2.1.24" 380 | } 381 | }, 382 | "unpipe": { 383 | "version": "1.0.0", 384 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 385 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 386 | }, 387 | "utils-merge": { 388 | "version": "1.0.1", 389 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 390 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 391 | }, 392 | "vary": { 393 | "version": "1.1.2", 394 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 395 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 396 | } 397 | } 398 | } 399 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ExpressAPI", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "convert-csv-to-json": "^1.3.1", 15 | "cors": "^2.8.5", 16 | "dotenv": "^10.0.0", 17 | "express": "^4.17.1" 18 | }, 19 | "engines": { 20 | "node": "14.18.0" 21 | } 22 | } 23 | --------------------------------------------------------------------------------