51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
/*
|
||
Elbab Merkezi Giriş Sistemi
|
||
|
||
Bu yazılım diğer yazılımlara kimlik verilerini iletmekte ve kimlik verilirini doğrulamakla yükümlüdür.
|
||
|
||
/api/v1 => yazılımın 1. api sürümüdür.
|
||
+ /token
|
||
+ /oauth => Gelen email ve şifre bilgilerini doğrular ve token oluşturup, iletir.
|
||
+ /verify => Gelen tokeni doğrular ve hesap bilgilerini iletir.
|
||
|
||
** Token içerisinde bulunacak bilgiler
|
||
- ID
|
||
- Name
|
||
- Surname
|
||
- Username
|
||
- Email
|
||
|
||
+ /get
|
||
- /accounts/id => Gelen hesap ID'lerine göre hesap bilgilerinin sunulması.
|
||
- /accounts/username => Gelen hesap kullanıcı adlarına göre hesap bilgilerinin sunulması.
|
||
- /accounts/email => Gelen hesap email adreslerine göre hesap bilgilerinin sunulması.
|
||
-* /accounts/status => Gelen hesap ID adresine göre hesap durumunun sunulması.
|
||
|
||
- /post
|
||
- /accounts/destroy => Gelen hesap ID adresine göre hesap bilgilerinin silinmesi.
|
||
- /accounts/create => Gelen hesap bilgilerine göre yeni bir hesabın kurulması.
|
||
- /accounts/update => Gelen hesap ID ve güncel bilgiler ile hesap bilgilerinin güncellenmesi.
|
||
*/
|
||
|
||
const express = require('express');
|
||
const app = express();
|
||
require('dotenv').config();
|
||
|
||
// DB
|
||
const sequelize = require('./config/db');
|
||
require('./models/accounts');
|
||
require('./models/logins');
|
||
require('./models/relations');
|
||
|
||
// USES
|
||
app.use(express.json());
|
||
app.use('/api/v1', require('./routes/app'));
|
||
|
||
(async () => {
|
||
await sequelize.sync({ force: false });
|
||
})();
|
||
|
||
const PORT = 5000;
|
||
app.listen(PORT, () => {
|
||
console.log(`${PORT} portunda Elbab Giriş Sistemi başlatıldı.`);
|
||
}); |