Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
h0lybyte committed Sep 16, 2023
1 parent c36ec79 commit dbea1e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions register/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const sdk = require("node-appwrite");
const axios = require("axios").require;
import { Client, Databases, Users } from "node-appwrite";
import axios from "axios";

module.exports = async (req, res) => {
export default async ({req, res}) => {
const errorHandler = (__errorMessage) => {
res.json({ data: "error", message: __errorMessage }, 400);
};
Expand All @@ -10,7 +10,7 @@ module.exports = async (req, res) => {
res.json({ data: _data }, 200);
};

const client = new sdk.Client();
const client = new Client();
if (
!req.variables["APPWRITE_FUNCTION_ENDPOINT"] ||
!req.variables["APPWRITE_FUNCTION_API_KEY"] ||
Expand All @@ -27,8 +27,8 @@ module.exports = async (req, res) => {
//.setSelfSigned(true);
}

const database = new sdk.Databases(client);
const users = new sdk.Users(client);
const database = new Databases(client);
const users = new Users(client);
let request = "";

if (req.payload) {
Expand Down

0 comments on commit dbea1e6

Please sign in to comment.