Good morning, I'm trying to connect the Earth Engine API to my server, but I'm encountering the following error.
Error: Server returned HTTP code: 404 at Object.ee.data.handleResponse_ (C:\Users\EST\Desktop\express\node_modules\@google\earthengine\build\main.js:9843:9) at Object.ee.data.send_ (C:\Users\EST\Desktop\express\node_modules\@google\earthengine\build\main.js:9792:18) at Object.ee.data.getAlgorithms (C:\Users\EST\Desktop\express\node_modules\@google\earthengine\build\main.js:9465:24) at Function.ee.ApiFunction.initialize (C:\Users\EST\Desktop\express\node_modules\@google\earthengine\build\main.js:10563:78) at Object.ee.initialize (C:\Users\EST\Desktop\express\node_modules\@google\earthengine\build\main.js:12110:26) at Object.<anonymous> (C:\Users\EST\Desktop\express\server.js:20:4) at Module._compile (internal/modules/cjs/loader.js:688:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: 'node server.js' npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\EST\AppData\Roaming\npm-cache\_logs18-11-21T11_18_17_293Z-debug.log
My code:
const express = require('express')
const server = express()
const port = 8080
var ee = require('@google/earthengine');
// Authenticate using one (but not both) of the methods below.
ee.data.authenticateViaPrivateKey('./Georreferenciamento -dcbe3c4e1089.json');
ee.initialize();
// Run an Earth Engine script.
var image = new ee.Image('srtm90_v4');
image.getMap({min: 0, max: 1000}, function(map) {
console.log(map);
});
server.listen(8080,()=>{
console.log('servidor de pé em http://localhost:8080')
console.log('Para desligar o servidor: ctrl + c')
})
Can anyone help me? Thank you in advance