a_and_b_galleries's Issues
remove litter
Remove unnecessary second option for res.render
Please check your code for other occurrences, here is one:
https://github.com/arakawarx7/a_and_b_galleries/blob/master/server.js#L63
rename data to something more meaningful
There are various points in the code where we pass data
to .render
.
consider renaming all occurrences of data
to something more meaningful to each case. For example, if it's a single photo a clear name would be singlePhoto
.
Here are some references, please check your code for other references:
https://github.com/arakawarx7/a_and_b_galleries/blob/master/server.js#L55-L59
https://github.com/arakawarx7/a_and_b_galleries/blob/master/server.js#L77-L80
remove database directory
refactor class/id attribute order in templates
change:
form(action='#' method='post').editForm
to:
form.editForm(action='#' method='post')
id/classes go after the element name and then attributes go in ( )
https://github.com/arakawarx7/a_and_b_galleries/blob/master/templates/edit.pug#L11
always .catch aka always handle errors
remove unnecessary pug require
use template string interpolation instead of ES6 Template Literals
https://pugjs.org/language/interpolation.html
https://github.com/arakawarx7/a_and_b_galleries/blob/master/templates/edit.pug#L25
change:
`/gallery/${data.id}` enctype="application/x-www-form-urlencoded")
to:
'/gallery/#{data.id}' enctype="application/x-www-form-urlencoded")
notice the back ticks became single-quotes and the string interpolation is achieved with #{}
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.