generated from azures04/Base-REST-API
Corrected a SQL syntax error in the databaseGlobals.js by removing an extraneous comma. Added a test script (test.js) to initialize the database and test user registration functionality.
19 lines
456 B
JavaScript
19 lines
456 B
JavaScript
const globals = require("./modules/databaseGlobals")
|
|
const userService = require("./services/userService")
|
|
|
|
async function main() {
|
|
globals.initializeDatabase()
|
|
try {
|
|
const result = await userService.register({
|
|
firstName: "User",
|
|
lastName: "Root",
|
|
username: "admin",
|
|
password: "changme"
|
|
})
|
|
console.log(result)
|
|
} catch (error) {
|
|
console.error(error)
|
|
}
|
|
}
|
|
|
|
main() |