add upload script
This commit is contained in:
parent
6496f2d0ab
commit
4300c092cf
4 changed files with 35 additions and 2 deletions
25
upload.js
Normal file
25
upload.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
require('dotenv').config();
|
||||
const fs = require('fs');
|
||||
var https = require('https');
|
||||
|
||||
var data = {
|
||||
branch: 'world',
|
||||
modules: {
|
||||
main: fs.readFileSync('./dist/screeps.js', 'utf-8').toString(),
|
||||
}
|
||||
};
|
||||
|
||||
var req = https.request({
|
||||
hostname: 'screeps.com',
|
||||
port: 443,
|
||||
path: '/api/user/code',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
'X-Token': process.env.SCREEPS_API_TOKEN
|
||||
}
|
||||
});
|
||||
|
||||
req.write(JSON.stringify(data));
|
||||
req.end();
|
||||
Loading…
Add table
Add a link
Reference in a new issue