mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-25 04:50:41 +03:00
Added .env file
This commit is contained in:
parent
f78ba38aa2
commit
5052de4dd6
4 changed files with 4 additions and 7 deletions
1
.env
Normal file
1
.env
Normal file
|
@ -0,0 +1 @@
|
||||||
|
MONGO_DB_URL = mongodb://localhost:27017/akf-forum
|
|
@ -18,10 +18,10 @@ And, you can learn informations about API in `APIDOCS.md`.
|
||||||
* [Camroku](https://github.com/Camroku) - Made stylesheets
|
* [Camroku](https://github.com/Camroku) - Made stylesheets
|
||||||
|
|
||||||
## To Do (Backend, bug fixes)
|
## To Do (Backend, bug fixes)
|
||||||
- Better error codes, example 400 for bad request
|
|
||||||
- `/errors/error` will change, better error page.
|
- `/errors/error` will change, better error page.
|
||||||
- Redirect query.
|
- Redirect query.
|
||||||
- middleware for timeouts
|
- middleware for timeouts
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
- [x] User
|
- [x] User
|
||||||
- [x] Login
|
- [x] Login
|
||||||
|
@ -48,11 +48,7 @@ And, you can learn informations about API in `APIDOCS.md`.
|
||||||
- [ ] Multiple theme support
|
- [ ] Multiple theme support
|
||||||
- [ ] Search
|
- [ ] Search
|
||||||
- [x] New Thread theme, better render for messages
|
- [x] New Thread theme, better render for messages
|
||||||
<<<<<<< HEAD
|
|
||||||
- [ ] Sending message etc. Will turn api model
|
- [ ] Sending message etc. Will turn api model
|
||||||
=======
|
|
||||||
- [ ] Sending message etc. will turn api model
|
|
||||||
>>>>>>> d2f644f6306f78b2888c933f90bf3c8e1c10b868
|
|
||||||
- [ ] API
|
- [ ] API
|
||||||
- [x] Other client for forum via API
|
- [x] Other client for forum via API
|
||||||
- [ ] Deleting message
|
- [ ] Deleting message
|
||||||
|
|
2
index.js
2
index.js
|
@ -7,7 +7,7 @@ const error = require("./errors/error.js"),
|
||||||
fs = require("fs"),
|
fs = require("fs"),
|
||||||
app = express();
|
app = express();
|
||||||
|
|
||||||
mongoose.connect('mongodb://localhost:27017/akf-forum', () =>console.log("Database is connected"));
|
mongoose.connect(process.env.MONGO_DB_URL, () => console.log("Database is connected"));
|
||||||
|
|
||||||
app.use(session({ secret: 'secret', resave: true, saveUninitialized: true }));
|
app.use(session({ secret: 'secret', resave: true, saveUninitialized: true }));
|
||||||
app.use(bodyParser.urlencoded({ extended: true }));
|
app.use(bodyParser.urlencoded({ extended: true }));
|
||||||
|
|
|
@ -18,7 +18,7 @@ app.post("/", async (req, res) => {
|
||||||
const user = await SecretModel.findOne({ username });
|
const user = await SecretModel.findOne({ username });
|
||||||
|
|
||||||
if (user)
|
if (user)
|
||||||
error(res, 404, `We have got an user named ${username}!`)
|
error(res, 400, `We have got an user named ${username}!`)
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue