Skip to content

Latest commit

 

History

History
76 lines (43 loc) · 1.73 KB

README.md

File metadata and controls

76 lines (43 loc) · 1.73 KB

smsapi

A REST API written in GoLang to send SMS to a Kannel server

Run

Test

Setup

Run

Set the credentials to be used by the API in the environment variables SMSAPI_USER and SMSAPI_PASS

go run src/smsapi/main.go

Access the API at http://localhost:8080/outbound/sms/

Test

Unit tests:

go test -v smsapi/router smsapi/handlers smsapi/models

This outputs the names of the tests being run and the result, along with the time taken to run each test. It also outputs a summary result and the total time taken to run all the tests.

API tests:

Install newman using npm install newman

Execute the tests using newman run /smsapi/SMSApiTestSuite.postman_collection.json

Setup

REST API:

go install smsapi/

Run the executable in /smsapi/bin

Kannel:

Install the Kannel software by following the instructions in the documentation.

Replace kannel.conf in /etc/kannel with this kannel.conf.

Modify /etc/default/kannel and uncomment the START_SMSBOX=1 line

Run Kannel as a service using the command

sudo service kannel start

Check the status of the Kannel gateway here.

SMPPSIM:

Install the Kannel software by following the instructions in the documentation.

Replace conf/smppsim.props in the installation directory with this smppsim.props.

Run the following command

sh startsmppsim.sh

Confirm the setup using the admin tool here.