Skip to content

Instantly share code, notes, and snippets.

@trungpv1601
Created May 9, 2019 08:14
Show Gist options
  • Save trungpv1601/2b744cabc9f9be094a587a2091eb7d5e to your computer and use it in GitHub Desktop.
Save trungpv1601/2b744cabc9f9be094a587a2091eb7d5e to your computer and use it in GitHub Desktop.
Netsuite Restlet sample
/**
*@NApiVersion 2.x
*@NScriptType Restlet
*/
define(
[
'N/search',
'N/record',
'N/cache',
'N/format'
],
function (search, record, cache, fmt) {
function get (context) {
try {
return { test: 'Hello World' };
} catch (err) {
log.audit({
title: 'GET',
details: JSON.stringify(err)
});
return err;
}
}
return {
get: get,
//delete: delete,
//post: post,
//put: put
};
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment