diff --git a/.eslintrc.json b/.eslintrc.json index 7e5a1dd078..9cbec86af3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,6 +12,9 @@ "node/no-unsupported-features/es-syntax": ["off"] }, "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, "sourceType": "module" } } diff --git a/frontend/run/nextjs-helloworld/app/layout.jsx b/frontend/run/nextjs-helloworld/app/layout.jsx new file mode 100644 index 0000000000..7db3f28ba1 --- /dev/null +++ b/frontend/run/nextjs-helloworld/app/layout.jsx @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License.; + +// [START cloudrun_nextjs_helloworld_service] +// [START run_nextjs_helloworld_service] +export default function RootLayout({children}) { + return ( + + {children} + + ); +} +// [END run_nextjs_helloworld_service] +// [END cloudrun_nextjs_helloworld_service] diff --git a/frontend/run/nextjs-helloworld/app/page.jsx b/frontend/run/nextjs-helloworld/app/page.jsx new file mode 100644 index 0000000000..6171c73360 --- /dev/null +++ b/frontend/run/nextjs-helloworld/app/page.jsx @@ -0,0 +1,21 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// [START cloudrun_nextjs_helloworld_service] +// [START run_nextjs_helloworld_service] +export default function Page() { + return

Hello, Next.js!

; +} +// [END run_nextjs_helloworld_service] +// [END cloudrun_nextjs_helloworld_service] diff --git a/frontend/run/nextjs-helloworld/package.json b/frontend/run/nextjs-helloworld/package.json new file mode 100644 index 0000000000..2158067ba9 --- /dev/null +++ b/frontend/run/nextjs-helloworld/package.json @@ -0,0 +1,28 @@ +{ + "name": "helloworld", + "description": "Simple hello world sample in Node", + "version": "1.0.0", + "private": true, + "main": "index.js", + "scripts": { + "start": "node index.js", + "test": "c8 mocha -p -j 2 test/app.test.js --exit", + "system-test": "NAME=Cloud c8 mocha -p -j 2 test/system.test.js --timeout=180000" + }, + "type": "module", + "engines": { + "node": ">=16.0.0" + }, + "author": "Google LLC", + "license": "Apache-2.0", + "dependencies": { + "express": "^4.17.1" + }, + "devDependencies": { + "c8": "^9.1.0", + "google-auth-library": "^9.6.3", + "got": "^14.2.0", + "mocha": "^10.3.0", + "supertest": "^6.3.4" + } +}