
net.officefloor.tutorial.javascripthttpserver.Validate.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JavaScriptHttpServer Show documentation
Show all versions of JavaScriptHttpServer Show documentation
Tutorial of implementing logic with JavaScript
The newest version!
const Request = Java.type("net.officefloor.tutorial.javascripthttpserver.Request");
const HttpException = Java.type("net.officefloor.server.http.HttpException");
function validate(request) {
if (request.getId() < 1) {
throw new HttpException(400, "Invalid identifier");
}
if (!request.getName()) {
throw new HttpException(400, "Must provide name");
}
}
validate.officefloor = [
{ httpObject : Request }
];
© 2015 - 2025 Weber Informatics LLC | Privacy Policy