mirror of
https://github.com/xfarrow/blink
synced 2025-06-27 09:03:02 +02:00
GET User
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
/*
|
||||
|
||||
This code is part of Blink
|
||||
licensed under GPLv3
|
||||
|
||||
@ -8,27 +7,23 @@
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// require() always returns a function
|
||||
const express = require('express');
|
||||
const api_controller = require('./api_controller.js');
|
||||
require('dotenv').config();
|
||||
|
||||
// We can do express() because the express
|
||||
// module exports a function. Exporting a function
|
||||
// means making a JavaScript function defined in one
|
||||
// module available for use in another module.
|
||||
const app = express();
|
||||
const port = 3000;
|
||||
const port = process.env.API_SERVER_PORT;
|
||||
|
||||
// Middleware which parses JSON for POST requests
|
||||
app.use(express.json());
|
||||
|
||||
app.post('/blinkapi/register', api_controller.register);
|
||||
|
||||
app.post('/blinkapi/login', api_controller.login);
|
||||
app.get('/blinkapi/person/:id', api_controller.verifyToken, api_controller.person);
|
||||
|
||||
// Start the server
|
||||
app.listen(port, () => {
|
||||
|
Reference in New Issue
Block a user