forked from IAdamAi/AdamAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
621 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var express = require('express'); // call express | ||
var app = express(); // define our app using express | ||
var bodyParser = require('body-parser'); | ||
|
||
app.use(bodyParser.urlencoded({ extended: true })); | ||
app.use(bodyParser.json()); | ||
|
||
var port = process.env.PORT || 8080; // set our port | ||
|
||
//To ping heroku app to prevent from sleeping | ||
setInterval(function() { | ||
http.get(process.env.HerokuURL); | ||
},1200000); | ||
|
||
var router = express.Router(); // get an instance of the express Router | ||
|
||
router.get('/', function(req, res) { | ||
res.json({ message: 'welcome to our ADAM AI api!' }); | ||
}); | ||
|
||
router.get('/hi', function(req, res) { | ||
res.json({ hi: 'Hello' }); | ||
}); | ||
|
||
app.use('/api', router); | ||
|
||
app.listen(port); | ||
console.log('Listening on port ' + port); |
Oops, something went wrong.