DEV Community

Muhammad Farooq
Muhammad Farooq

Posted on

Run the back end and test the API Functions of Apache Age Viewer Desktop (Go)

Git hub repository

the git hub repository of Age viewer Desktop is

https://github.com/apache/age/tree/ageviewer_go

clone the ageviewer_go branch of Apache AGE

to clone run the following command on terminal in the folder where you want to clone the branch of the repository

git clone -b ageviewer_go https://github.com/apache/age

run the back-end

to run the back-end

  • open a new terminal

  • start PostgreSQL server
    go to PostgreSQL installation folder

let suppose the Database cluster name is demo

then you can install the PostgreSQL server using following command
bin/pg_ctl -D demo start

  • open a database let say demodb

bin/psql demodb

if not created any you can create using the following command
bin/createdb demodb
and then open the database

  • Open the cloned repository in an IDE like VS code

  • Go to the back-end folder of the Repo

  • Open APIfunction.js file and make changes in it.

uncomment the code
enter you PostgreSQL credentials instead of given.

change name of APIfunction.js to APIfunction.mjs

make changes as directed in this pull request:
https://github.com/apache/age/pull/869

you may need to run the following command if you get an error

npm install node-fetch

to install node-fetch module and other dependencies

  • now open a new terminal and go to the back-end folder of cloned repository

  • now run the following command

go run .

this will start the back-end of the project

  • open a new terminal go to the back-end folder to test the API functions

  • then run the following command

node APIfunctions.mjs
and then test the functions

I hope this tutorial will help you

visit Apache AGE

Official website

Apache Age Github

Top comments (0)