Skip to content

Commit aa201db

Browse files
committed
ci(metadata/flexible): migrate to new CI
1 parent 9a866b8 commit aa201db

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

.github/config/nodejs-prod.jsonc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
// TODO: fix these
7878
"ai-platform/snippets", // PERMISSION_DENIED: Permission denied: Consumer 'projects/undefined' has been suspended.
7979
"appengine/analytics", // [ERR_REQUIRE_ESM]: require() of ES Module
80-
"appengine/metadata/flexible", // [ERR_REQUIRE_ESM]: require() of ES Module
8180
"automl", // (untested) FAILED_PRECONDITION: Google Cloud AutoML Natural Language was retired on March 15, 2024. Please migrate to Vertex AI instead
8281
"cloud-sql/mysql/mysql", // (untested) Error: expected 200 "OK", got 500 "Internal Server Error"
8382
"cloud-sql/mysql/mysql2", // (untested) Error: Cannot find module './connect-connector-with-iam-authn.js'

appengine/metadata/flexible/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"type": "git",
1010
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1111
},
12+
"type": "module",
1213
"engines": {
1314
"node": ">= 18.x.x"
1415
},

appengine/metadata/flexible/server.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_metadata]
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');
@@ -58,4 +58,4 @@ app.listen(PORT, () => {
5858
console.log('Press Ctrl+C to quit.');
5959
});
6060
// [END gae_flex_metadata]
61-
module.exports = app;
61+
export default app;

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
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+
116
const path = require('path');
217
const app = require(path.join(__dirname, '../', 'server.js'));
318
const supertest = require('supertest');

0 commit comments

Comments
 (0)