I had the same problem before , and I found out an easier way to accomplish 
this.
create an empty DIRECTORY and name it hello (In window , mkdir hello)
Get into this DIrectory (cd hello)
execute this command ,  foxx init -e
This will create the initial files you can start with ( manifest.json, 
index.js)
Next, you ZIP the directory file hello ( you have to go out 1 level higher 
to your hello Directory, you can do  cd ..)
you can now xompressed ZIP file your Deirectory hello to hello.zip.

Go to your ARANGODB  web interface by browsing 
http://127.0.0.1:8529/_db/_system/_admin/aardvark/index.html#login
LOGIN as root or any user that can access ARANGODB.

GO TO SERVICES > Add Service > Upload > Drag&Drop your hello.Zip file > 
Install > 

Enter a Mount point: /hello > Install 

VIOLA you got your /hello Foxx API Services > CLICK on it > API

You can now revise your manifest.json and index.js files to run an API.

Refer to this site to create some simple foxx APIs
https://www.arangodb.com/docs/3.6/foxx-getting-started.html

CHEERS .... ENJOY....



On Monday, August 10, 2020 at 7:06:19 PM UTC+8 [email protected] wrote:

> Hello,
>
> i followed the instructions on from "getting started".
>
> When i upload and install the service i get the message "Services: service 
> undefined installed" and the the API section of the service i can only see 
> a swagger button which show me this:
>
> {
>  "swagger": "2.0",
>  "basePath": "/_db/telefonie/getting-started",
>  "paths": {
>  "/hello-world": {
>  "get": {
>  "produces": [
>  "text/plain",
>  "application/json"
>  ],
>  "parameters": [],
>  "description": "Prints a generic greeting.",
>  "summary": "Generic greeting",
>  "tags": [],
>  "consumes": [],
>  "responses": {
>  "200": {
>  "schema": {
>  "type": "string"
>  },
>  "description": "A generic greeting."
>  },
>  "500": {
>  "description": "Default error response.",
>  "schema": {
>  "type": "object",
>  "properties": {
>  "error": {
>  "anyOf": [
>  {
>  "type": "any",
>  "enum": [
>  true
>  ]
>  },
>  {
>  "type": [
>  "array",
>  "boolean",
>  "number",
>  "object",
>  "string",
>  "null"
>  ]
>  }
>  ]
>  },
>  "errorNum": {
>  "type": "integer"
>  },
>  "errorMessage": {
>  "type": "string"
>  },
>  "code": {
>  "type": "integer"
>  }
>  },
>  "additionalProperties": false,
>  "patterns": [],
>  "required": [
>  "error"
>  ]
>  }
>  }
>  }
>  }
>  }
>  },
>  "info": {
>  "description": "",
>  "license": {}
>  }
> }
>
>
>
> Manifest.json
>
> {
>   "engines": {
>     "arangodb": "^3.0.0"
>   },
>   "main": "index.js"
> }
>
>
> index.js
>
> 'use strict';
> const createRouter = require('@arangodb/foxx/router');
> const router = createRouter();
>
>
> module.context.use(router);
>
>
> router.get('/hello-world', function (req, res) {
>   res.send('Hello World!');
> })
> .response(['text/plain'], 'A generic greeting.')
> .summary('Generic greeting')
> .description('Prints a generic greeting.');
>
> Would be nice if someone could give me a hint where the issue is.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/arangodb/3655fd85-c3ac-4b7d-8413-744fd1ba9e06n%40googlegroups.com.

Reply via email to