Skip to content

Commit e580fd9

Browse files
committed
add other appengine migration
1 parent 5f786e9 commit e580fd9

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

.github/config/nodejs-prod.jsonc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676

7777
// TODO: fix these
7878
"ai-platform/snippets", // PERMISSION_DENIED: Permission denied: Consumer 'projects/undefined' has been suspended.
79-
"appengine/analytics", // [ERR_REQUIRE_ESM]: require() of ES Module
8079
"automl", // (untested) FAILED_PRECONDITION: Google Cloud AutoML Natural Language was retired on March 15, 2024. Please migrate to Vertex AI instead
8180
"cloud-sql/mysql/mysql", // (untested) Error: expected 200 "OK", got 500 "Internal Server Error"
8281
"cloud-sql/mysql/mysql2", // (untested) Error: Cannot find module './connect-connector-with-iam-authn.js'

appengine/analytics/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
'use strict';
1616

1717
// [START gae_flex_analytics_track_event]
18-
const express = require('express');
19-
const fetch = require('node-fetch');
18+
import express from 'express';
19+
import fetch from 'node-fetch';
2020

2121
const app = express();
2222
app.enable('trust proxy');
@@ -77,4 +77,4 @@ app.listen(PORT, () => {
7777

7878
// [END gae_flex_analytics_track_event]
7979

80-
module.exports = app;
80+
export default app;

appengine/analytics/test/app.test.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
const supertest = require('supertest');
2-
const path = require('path');
3-
const app = require(path.join(__dirname, '../', 'app.js'));
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import supertest from 'supertest';
16+
import app from '../app.js';
417

518
describe('gae_flex_analytics_track_event', () => {
619
it('should be listening', async () => {

appengine/metadata/flexible/test/server.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
1615
import supertest from 'supertest';
1716
import app from '../server.js';
1817

0 commit comments

Comments
 (0)