diff --git a/README.md b/README.md index 2222d38..a13bb6a 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,42 @@ -# WOD API - Words Of Domain API - -WOD API is a quick and simple API to get words of a domain name. - -## Key features - -* Purely Python -* It's an API with only 1 endpoint -* Needs flask library -* Needs wordsegment library - -## Requirements - -WOD API requires **flask** and **wordsegment** Python libraries: - -* pip install flask -* pip install wordsegment - -## Usage - -- Run: python .\wodapi.py -- Then, a server is deploy on http://127.0.0.1:5000 -- Use GET in endpoing domain: http://127.0.0.1:5000/domain/hereyourdomainname - -## Documentation - -This is the README file - -## Authors - - * Bichi - José Mª Ávila - * Antonio Villamarin - -## License - -This is a NIDOMA development - -## Links - -- https://grantjenks.com/docs/wordsegment/ -- https://pypi.org/project/wordsegment/ +# WOD API - Words Of Domain API + +WOD API is a quick and simple API to get words of a domain name. + +## Key features + +* Purely Python +* It's an API with only 1 endpoint +* Needs flask library +* Needs wordsegment library + +## Requirements + +WOD API requires **flask** and **wordsegment** Python libraries: + +* pip install flask +* pip install wordsegment + +## Usage + +- Run: python .\wodapi.py +- Then, a server is deploy on http://127.0.0.1:5000 +- Use GET in endpoing domain: http://127.0.0.1:5000/domain/hereyourdomainname + +## Documentation + +This is the README file + +## Authors + + * Bichi - José Mª Ávila + * Antonio Villamarin + +## License + +This is a NIDOMA development + +## Links + +- https://grantjenks.com/docs/wordsegment/ +- https://pypi.org/project/wordsegment/ - https://blog.stoplight.io/python-rest-api \ No newline at end of file diff --git a/wodapi.py b/wodapi.py new file mode 100644 index 0000000..4bac5a6 --- /dev/null +++ b/wodapi.py @@ -0,0 +1,13 @@ +import wordsegment +from wordsegment import load, segment +from flask import Flask, json, request +load() + +api = Flask(__name__) + +@api.route('/domain/', methods=['GET']) +def get_words(name: str): + return json.dumps(segment(name)) + +if __name__ == '__main__': + api.run() \ No newline at end of file