Expand my Community achievements bar.

SOLVED

Basic NodeJS application creation and deploy to Adobe IO runtime

Avatar

Level 9

Hello team,

 

I am exploring Adobe IO runtime. I tried to create a simple rest API (as mentioned below) and I am able to hit the runtime using browser.

https://adobeioruntime.net/api/v1/web/12345-pocservice-dev/default/test?name=ABC

 

// this is saved in a file named first-function.js
function main(params) {
var nm = params.name || 'stranger';
return {
statusCode: 200,
body: {
payload: 'Hello ' + nm
}
}
}

exports.main = main;

 

Now, I need to write some NodeJS utility, which will have folders like: src, tests, config etc.

Now, sure about the way I need to create?  Help will be much appreciated here.

cc @sarav_prakash  @mk_aem21 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
3 Replies

Avatar

Correct answer by
Community Advisor

Hi @Mahesh_Gunaje 

You can check smaple apps at https://developer.adobe.com/app-builder/docs/resources/sample_apps/ , if that helps



Arun Patidar

Avatar

Level 9

Thanks a lot @arunpatidar  for your quick help

Now, I have started referring to headless app

https://github.com/AdobeDocs/adobeio-codelabs-barcode

 

New to NodeJS, Adobe IO runtime.  Is there any documents related to best practices while setting up the project for the headless app in Adobe IO runtime? example: Nodejs version, folder, file structure etc ...

In the file: manifest.yml, I can see the sttement: runtime: 'nodejs:14'

Is this OK? Since, latest version is 22+. Also, in the runtime I can see NodeJS version: 18

 

Thanks