Skip to content

Instantly share code, notes, and snippets.

@nqd
nqd / vscode setup
Created July 14, 2020 07:49
vscode setup
# setup
const request = require('supertest')
const app = require('../../server/server')
const faker = require('faker')
const expect = require('chai').expect
function req (verb, url) {
return request(app)[verb](url)
.set('Content-Type', 'application/json')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
GET /firmware/:application/versions
HEADERS:
id: id
token: token
host: esp
version: current version
image: image
{
application: application,
last: {
version: 0.1.100,
created: timestamp,
host: cdn-host,
url: url
}
}
curl -I https://dl.dropboxusercontent.com/s/jwnjhet4tngh3nh/user1.bin\?dl\=0
HTTP/1.1 200 OK
accept-ranges: bytes
cache-control: max-age=0
content-disposition: inline; filename="user1.bin"; filename*=UTF-8''user1.bin
Content-Length: 387808
Content-Type: application/octet-stream
Date: Thu, 14 May 2015 07:07:36 GMT
etag: 1n
pragma: public
{
"url": "https://dl.dropboxusercontent.com/s/jwnjhet4tngh3nh/user1.bin?dl=0",
"expires": "Tue, 01 Jan 2030 00:00:00 GMT",
"direct": true
}
@nqd
nqd / curl-file-1
Last active August 29, 2015 14:21
curl -I https://db.tt/agqgwH1T
HTTP/1.1 302 FOUND
Server: nginx
Date: Thu, 14 May 2015 06:52:09 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
location: https://www.dropbox.com/s/jwnjhet4tngh3nh/user1.bin?dl=0
pragma: no-cache
cache-control: no-cache
{
"url": "https://db.tt/agqgwH1T",
"expires": "Tue, 01 Jan 2030 00:00:00 GMT",
"direct": false
}
var Dropbox = require("dropbox");
// Browser-side applications do not use the API secret.
var client = new Dropbox.Client({
token: "your-token"
});
client.authenticate(function(error, client) {
if (error) {
return console.log(error);