mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-24 20:40: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
|
||||
|
||||
## To Do (Backend, bug fixes)
|
||||
- Better error codes, example 400 for bad request
|
||||
- `/errors/error` will change, better error page.
|
||||
- Redirect query.
|
||||
- middleware for timeouts
|
||||
|
||||
## Roadmap
|
||||
- [x] User
|
||||
- [x] Login
|
||||
|
@ -48,11 +48,7 @@ And, you can learn informations about API in `APIDOCS.md`.
|
|||
- [ ] Multiple theme support
|
||||
- [ ] Search
|
||||
- [x] New Thread theme, better render for messages
|
||||
<<<<<<< HEAD
|
||||
- [ ] Sending message etc. Will turn api model
|
||||
=======
|
||||
- [ ] Sending message etc. will turn api model
|
||||
>>>>>>> d2f644f6306f78b2888c933f90bf3c8e1c10b868
|
||||
- [ ] API
|
||||
- [x] Other client for forum via API
|
||||
- [ ] Deleting message
|
||||
|
|
2
index.js
2
index.js
|
@ -7,7 +7,7 @@ const error = require("./errors/error.js"),
|
|||
fs = require("fs"),
|
||||
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(bodyParser.urlencoded({ extended: true }));
|
||||
|
|
|
@ -18,7 +18,7 @@ app.post("/", async (req, res) => {
|
|||
const user = await SecretModel.findOne({ username });
|
||||
|
||||
if (user)
|
||||
error(res, 404, `We have got an user named ${username}!`)
|
||||
error(res, 400, `We have got an user named ${username}!`)
|
||||
|
||||
else {
|
||||
|
||||
|
|
Loading…
Reference in a new issue