diff options
author | terminaldweller <thabogre@gmail.com> | 2022-07-06 13:34:45 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-07-06 13:34:45 +0000 |
commit | da98e1dee68e421bdd7cfcf332c43a1f94a43a30 (patch) | |
tree | 792f70ee92e096d69d9989481a736ff3af0590c7 /put_in_db.js | |
parent | was using node image for self-signed certificates (diff) | |
parent | fix for atom (diff) | |
download | blog-da98e1dee68e421bdd7cfcf332c43a1f94a43a30.tar.gz blog-da98e1dee68e421bdd7cfcf332c43a1f94a43a30.zip |
Merge branch 'rss'
Diffstat (limited to 'put_in_db.js')
-rw-r--r-- | put_in_db.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/put_in_db.js b/put_in_db.js new file mode 100644 index 0000000..da5a050 --- /dev/null +++ b/put_in_db.js @@ -0,0 +1,26 @@ +"use strict"; +// mongosh --host 127.0.0.1 --port 27117 -u mongo -p mongo -f put_in_db.js + +const fs = require("fs"); +const path = require("path"); +// db = connect("http://mongo:mongo@127.0.0.1:27117"); + +blog_entry_1 = { + title: "Turning C structs into Lua tables", + slug: "c_struct_lua_table", + body: fs.readFileSync(path.join(__dirname) + "/mds/cstruct2luatable.md"), + teaser: "Turning C structures into Lua tables", + keywords: "c,lua", + lastUpdatedAt: Date.now(), +}; + +blog_entry_2 = { + title: "Lazy Makefiles", + slug: "lazy_makefile", + body: fs.readFileSync(path.join(__dirname) + "/mds/lazymakefiles.md"), + teaser: "Lazy Makefiles", + keywords: "makefile,c,c++", + lastUpdatedAt: Date.now(), +}; + +db.blogposts.insertMany([blog_entry_1, blog_entry_2]); |